ContextMenu: show submenu on hover after a timeout

This means that the parent menu still get the mouse events

Also add the ability to close the menu programmatically
This commit is contained in:
Olivier Goffart 2025-02-07 13:27:32 +01:00 committed by GitHub
parent feb7a864df
commit c0b72cad2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 125 additions and 35 deletions

View file

@ -156,7 +156,7 @@ public:
auto p = pos(popup);
auto popup_dyn = popup.into_dyn();
auto id = cbindgen_private::slint_windowrc_show_popup(&inner, &popup_dyn, p, close_policy,
&parent_item);
&parent_item, false);
popup->user_init();
return id;
}
@ -179,7 +179,7 @@ public:
auto popup_dyn = popup.into_dyn();
auto id = cbindgen_private::slint_windowrc_show_popup(
&inner, &popup_dyn, pos, cbindgen_private::PopupClosePolicy::CloseOnClickOutside,
&context_menu_rc);
&context_menu_rc, true);
popup->user_init();
return id;
}