1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:27:45 +00:00

WindowServer+LibGUI: Show action icons in the menus when possible

Any GAction that has an icon assigned will now show up with that icon
when added to a menu as well.

I made the menu items 2px taller to accomodate the icons. I think this
turned out quite nice as well :^)
This commit is contained in:
Andreas Kling 2019-08-26 18:54:44 +02:00
parent d522a6fe4c
commit 1e604b7984
11 changed files with 61 additions and 11 deletions

View file

@ -4,6 +4,7 @@
#include <AK/Function.h>
#include <LibDraw/Rect.h>
class GraphicsBitmap;
class WSMenu;
class WSMenuItem {
@ -40,6 +41,9 @@ public:
unsigned identifier() const { return m_identifier; }
const GraphicsBitmap* icon() const { return m_icon; }
void set_icon(const GraphicsBitmap* icon) { m_icon = icon; }
private:
WSMenu& m_menu;
Type m_type { None };
@ -50,4 +54,5 @@ private:
String m_text;
String m_shortcut_text;
Rect m_rect;
RefPtr<GraphicsBitmap> m_icon;
};