1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 06:44:57 +00:00

LibGUI: Don't show "Invalid" for menu items without a keyboard shortcut

This commit is contained in:
Andreas Kling 2019-12-02 15:54:01 +01:00
parent d7177212fd
commit af9fd334f3
2 changed files with 4 additions and 2 deletions

View file

@ -56,5 +56,6 @@ void GMenuItem::update_window_server()
if (m_menu_id < 0)
return;
auto& action = *m_action;
GWindowServerConnection::the().send_sync<WindowServer::UpdateMenuItem>(m_menu_id, m_identifier, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, action.shortcut().to_string());
auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : String();
GWindowServerConnection::the().send_sync<WindowServer::UpdateMenuItem>(m_menu_id, m_identifier, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, shortcut_text);
}