mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:57:46 +00:00
WindowServer: Rework and simplify Menu event handling
The menu manager will now send events directly to the current menu. Previously if a menu was opened it would always be set as the current menu. Now when opening a menu you can optionally say that you do not want to have it as the current menu. One scenerio when this happens is when a menu is popped up as part of a preview, for example, when hovering over a menu item that is a submenu. Sending the event to the current menu simplifies things and solves a few inconsistencies in bevhaviour (such as hovering over a submenu, but key events not being sent to the submenu).
This commit is contained in:
parent
b1c83e5a64
commit
d5c40899cb
4 changed files with 80 additions and 77 deletions
|
@ -53,8 +53,8 @@ public:
|
|||
void set_needs_window_resize();
|
||||
|
||||
Menu* current_menu() { return m_current_menu.ptr(); }
|
||||
void set_current_menu(Menu*, bool is_submenu = false);
|
||||
void open_menu(Menu&);
|
||||
void set_current_menu(Menu*);
|
||||
void open_menu(Menu&, bool as_current_menu = true);
|
||||
void toggle_menu(Menu&);
|
||||
|
||||
MenuBar* current_menubar() { return m_current_menubar.ptr(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue