mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Add support for manually closing PopupWindows
This patch adds a `close()` function that can be called to close a popup window, and a `close-to-click` boolean that can be set to false to disable the default behavior.
This commit is contained in:
parent
a0a5294e49
commit
0f54b9599b
20 changed files with 349 additions and 24 deletions
14
internal/compiler/tests/syntax/elements/popup.slint
Normal file
14
internal/compiler/tests/syntax/elements/popup.slint
Normal file
|
@ -0,0 +1,14 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
|
||||
export Bar := Rectangle {
|
||||
in property <bool> external;
|
||||
PopupWindow {
|
||||
close-on-click: true;
|
||||
}
|
||||
PopupWindow {
|
||||
close-on-click: root.external;
|
||||
// ^error{The close-on-click property only supports constants at the moment}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue