1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

Plumb menu item activation events from WindowServer to clients.

GMenu now has an "on_item_activation" callback that fires whenever one
of its items are activated. The menu item identifier is used to distinguish
between items.

Use this to implement font switching in Terminal. :^)
This commit is contained in:
Andreas Kling 2019-02-12 10:08:35 +01:00
parent 9c1c885483
commit db98327bdc
10 changed files with 93 additions and 3 deletions

View file

@ -67,6 +67,7 @@ struct GUI_Event {
WindowActivated,
WindowDeactivated,
WindowCloseRequest,
MenuItemActivated,
};
Type type { Invalid };
int window_id { -1 };
@ -88,6 +89,10 @@ struct GUI_Event {
bool alt : 1;
bool shift : 1;
} key;
struct {
int menu_id;
unsigned identifier;
} menu;
};
};