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

LibGUI+WindowServer: Flash menubar menu when using a keyboard shortcut

Briefly flash the menubar menu containing the keyboard shortcut action
to give the user immediate visual feedback on their interaction with the
system.
This commit is contained in:
bugreport0 2021-10-03 12:33:08 +02:00 committed by Andreas Kling
parent ed0f4bdfaf
commit 6c049ea4c4
11 changed files with 88 additions and 1 deletions

View file

@ -135,6 +135,14 @@ void Action::activate(Core::Object* activator)
m_activator = nullptr;
}
void Action::flash_menubar_menu()
{
if (auto* app = Application::the())
if (auto* window = app->active_window())
for (auto& menu_item : m_menu_items)
window->flash_menubar_menu_for(*menu_item);
}
void Action::register_button(Badge<Button>, Button& button)
{
m_buttons.set(&button);