mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58:11 +00:00
WindowServer: Don't keep menu items in hovered state after the cursor leaves.
This commit is contained in:
parent
6dd1a1f26d
commit
e6de6c4f45
3 changed files with 16 additions and 2 deletions
|
@ -114,12 +114,19 @@ void WSMenu::on_window_message(WSMessage& message)
|
|||
if (!m_hovered_item)
|
||||
return;
|
||||
did_activate(*m_hovered_item);
|
||||
m_hovered_item = nullptr;
|
||||
redraw();
|
||||
clear_hovered_item();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void WSMenu::clear_hovered_item()
|
||||
{
|
||||
if (!m_hovered_item)
|
||||
return;
|
||||
m_hovered_item = nullptr;
|
||||
redraw();
|
||||
}
|
||||
|
||||
void WSMenu::did_activate(WSMenuItem& item)
|
||||
{
|
||||
if (on_item_activation)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue