1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

WindowServer: Clean up some of the code around menu item hovering

We were writing to the currently hovered menu item index in a bunch
of places, which made it very confusing to follow how it changes.

Rename Menu::set_hovered_item() to set_hovered_index() and use it
in more places instead of manipulating m_hovered_item_index.
This commit is contained in:
Andreas Kling 2021-04-15 17:42:23 +02:00
parent 9f4e37e342
commit b75d2d36e1
4 changed files with 35 additions and 40 deletions

View file

@ -493,7 +493,7 @@ void Window::handle_keydown_event(const KeyEvent& event)
if (menu_to_open) {
frame().open_menubar_menu(*menu_to_open);
if (!menu_to_open->is_empty())
menu_to_open->set_hovered_item(0);
menu_to_open->set_hovered_index(0);
return;
}
}