mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +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:
parent
ed0f4bdfaf
commit
6c049ea4c4
11 changed files with 88 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Desktop.h>
|
||||
#include <LibGUI/Event.h>
|
||||
#include <LibGUI/MenuItem.h>
|
||||
#include <LibGUI/Menubar.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
|
@ -1204,6 +1205,15 @@ Menu& Window::add_menu(String name)
|
|||
return *menu;
|
||||
}
|
||||
|
||||
void Window::flash_menubar_menu_for(const MenuItem& menu_item)
|
||||
{
|
||||
auto menu_id = menu_item.menu_id();
|
||||
if (menu_id < 0)
|
||||
return;
|
||||
|
||||
WindowServerConnection::the().async_flash_menubar_menu(m_window_id, menu_id);
|
||||
}
|
||||
|
||||
bool Window::is_modified() const
|
||||
{
|
||||
if (!m_window_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue