mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +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
|
@ -161,13 +161,16 @@ public:
|
|||
}
|
||||
|
||||
template<typename Component, typename Parent>
|
||||
void show_popup(const Parent *parent_component, cbindgen_private::Point p,
|
||||
void show_popup(const Parent *parent_component, cbindgen_private::Point p, bool close_on_click,
|
||||
cbindgen_private::ItemRc parent_item) const
|
||||
{
|
||||
auto popup = Component::create(parent_component).into_dyn();
|
||||
cbindgen_private::slint_windowrc_show_popup(&inner, &popup, p, &parent_item);
|
||||
cbindgen_private::slint_windowrc_show_popup(&inner, &popup, p, close_on_click,
|
||||
&parent_item);
|
||||
}
|
||||
|
||||
void close_popup() const { cbindgen_private::slint_windowrc_close_popup(&inner); }
|
||||
|
||||
template<std::invocable<RenderingState, GraphicsAPI> F>
|
||||
std::optional<SetRenderingNotifierError> set_rendering_notifier(F callback) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue