1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

WindowServer: Organize system menu app shortcuts into categories

If the .af file for an app contains the App/Category key, we'll now put
it in a submenu of the system menu, together with all the other apps in
that same category. This is pretty neat! :^)
This commit is contained in:
Andreas Kling 2019-11-11 10:43:03 +01:00
parent 3a71c018bf
commit 74be54cce8
5 changed files with 77 additions and 20 deletions

View file

@ -1,6 +1,7 @@
#include "WSMenuItem.h"
#include "WSClientConnection.h"
#include "WSMenu.h"
#include "WSWindowManager.h"
#include <LibDraw/GraphicsBitmap.h>
WSMenuItem::WSMenuItem(WSMenu& menu, unsigned identifier, const String& text, const String& shortcut_text, bool enabled, bool checkable, bool checked, const GraphicsBitmap* icon)
@ -45,6 +46,7 @@ void WSMenuItem::set_checked(bool checked)
WSMenu* WSMenuItem::submenu()
{
ASSERT(is_submenu());
ASSERT(m_menu.client());
return m_menu.client()->find_menu_by_id(m_submenu_id);
if (m_menu.client())
return m_menu.client()->find_menu_by_id(m_submenu_id);
return WSWindowManager::the().find_internal_menu_by_id(m_submenu_id);
}