mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +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:
@@ -71,6 +71,14 @@ void MenuItem::set_checked(bool checked)
|
||||
m_menu.redraw();
|
||||
}
|
||||
|
||||
void MenuItem::set_default(bool is_default)
|
||||
{
|
||||
if (m_default == is_default)
|
||||
return;
|
||||
m_default = is_default;
|
||||
m_menu.redraw();
|
||||
}
|
||||
|
||||
Menu* MenuItem::submenu()
|
||||
{
|
||||
ASSERT(is_submenu());
|
||||
|
||||
Reference in New Issue
Block a user