mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
WindowServer: Don't allow activating disabled menu items with keyboard
This commit is contained in:
parent
e786444ffa
commit
9badcff1ba
1 changed files with 3 additions and 1 deletions
|
@ -393,6 +393,8 @@ void Menu::event(Core::Event& event)
|
|||
}
|
||||
|
||||
if (key == Key_Return) {
|
||||
if (!hovered_item()->is_enabled())
|
||||
return;
|
||||
if (hovered_item()->is_submenu())
|
||||
descend_into_submenu_at_hovered_item();
|
||||
else
|
||||
|
@ -461,7 +463,7 @@ void Menu::event(Core::Event& event)
|
|||
}
|
||||
|
||||
if (key == Key_Right) {
|
||||
if (hovered_item()->is_submenu())
|
||||
if (hovered_item()->is_enabled() && hovered_item()->is_submenu())
|
||||
descend_into_submenu_at_hovered_item();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue