1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +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

@ -101,10 +101,10 @@ public:
MenuItem* hovered_item() const;
void set_hovered_item(int index)
void set_hovered_index(int index, bool make_input = false)
{
m_hovered_item_index = index;
update_for_new_hovered_item();
update_for_new_hovered_item(make_input);
}
void clear_hovered_item();