diff options
author | networkException <git@nwex.de> | 2022-01-28 15:54:39 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-29 11:22:02 +0100 |
commit | e2df145e14e82b14a41c9c13ededb52713bf3f05 (patch) | |
tree | 6a99a9418aa886c806d6b48e7dad6ed514ee9015 /Userland/Services/WindowServer | |
parent | d748a3c17351926e641928816643118d4d160ded (diff) | |
download | serenity-e2df145e14e82b14a41c9c13ededb52713bf3f05.zip |
WindowServer: Allow checking checkable entries in a menu using space
Diffstat (limited to 'Userland/Services/WindowServer')
-rw-r--r-- | Userland/Services/WindowServer/MenuManager.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/MenuManager.cpp b/Userland/Services/WindowServer/MenuManager.cpp index 1d46feee29..8c0aa61574 100644 --- a/Userland/Services/WindowServer/MenuManager.cpp +++ b/Userland/Services/WindowServer/MenuManager.cpp @@ -137,6 +137,17 @@ void MenuManager::event(Core::Event& event) m_current_menu->open_hovered_item(key_event.modifiers() & KeyModifier::Mod_Ctrl); return; } + + if (key_event.key() == Key_Space) { + auto* hovered_item = m_current_menu->hovered_item(); + if (!hovered_item || !hovered_item->is_enabled()) + return; + if (!hovered_item->is_checkable()) + return; + + m_current_menu->open_hovered_item(true); + } + m_current_menu->dispatch_event(event); } } |