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:
Simon Hausmann 2023-06-02 08:12:39 +02:00 committed by Simon Hausmann
parent a0a5294e49
commit 0f54b9599b
20 changed files with 349 additions and 24 deletions

View 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}
}
}