mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:57:34 +00:00
WindowServer: Add support for default MenuItem
This allows marking a MenuItem as a default action, e.g. in a context menu for an action that reflects what e.g. a double click would perform. Also enhance the window menu to mark the close action as the default, and when double clicked perform that action. Fixes #1289
This commit is contained in:
parent
684b04e02a
commit
fc4e01a3c9
10 changed files with 194 additions and 32 deletions
|
@ -58,6 +58,9 @@ public:
|
|||
bool is_checked() const { return m_checked; }
|
||||
void set_checked(bool);
|
||||
|
||||
bool is_default() const { return m_default; }
|
||||
void set_default(bool);
|
||||
|
||||
String text() const { return m_text; }
|
||||
void set_text(const String& text) { m_text = text; }
|
||||
|
||||
|
@ -88,6 +91,7 @@ private:
|
|||
bool m_enabled { true };
|
||||
bool m_checkable { false };
|
||||
bool m_checked { false };
|
||||
bool m_default { false };
|
||||
unsigned m_identifier { 0 };
|
||||
String m_text;
|
||||
String m_shortcut_text;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue