1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

WindowServer+LibGfx: Show menus in windows! :^)

This patch begins the transition away from the global menu towards
per-window menus instead.

The global menu looks neat, but has always felt clunky, and there
are a number of usability problems with it, especially in programs
with multiple windows.

You can now call GUI::Window::set_menubar() to add a menubar to
your window. It will be specific to that one window only.
This commit is contained in:
Andreas Kling 2021-03-25 21:01:19 +01:00
parent 1daaa4f38d
commit e76771bfad
21 changed files with 335 additions and 44 deletions

View file

@ -113,6 +113,10 @@ public:
const Window* active_input_window() const { return m_active_input_window.ptr(); }
const ClientConnection* active_client() const;
Window* window_with_active_menu() { return m_window_with_active_menu; }
const Window* window_with_active_menu() const { return m_window_with_active_menu; }
void set_window_with_active_menu(Window*);
const Window* highlight_window() const { return m_highlight_window.ptr(); }
void set_highlight_window(Window*);
@ -329,6 +333,7 @@ private:
WeakPtr<Window> m_highlight_window;
WeakPtr<Window> m_active_input_window;
WeakPtr<Window> m_active_input_tracking_window;
WeakPtr<Window> m_window_with_active_menu;
WeakPtr<Window> m_move_window;
Gfx::IntPoint m_move_origin;