mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 17:47:18 +00:00
LibGUI: Add GAction class and make GMenu deal in actions rather than strings.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "GEvent.h"
|
||||
#include "GObject.h"
|
||||
#include "GWindow.h"
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GNotifier.h>
|
||||
#include <LibGUI/GMenu.h>
|
||||
#include <LibC/unistd.h>
|
||||
@@ -156,8 +157,8 @@ void GEventLoop::handle_menu_event(const GUI_Event& event)
|
||||
dbgprintf("GEventLoop received event for invalid window ID %d\n", event.window_id);
|
||||
return;
|
||||
}
|
||||
if (menu->on_item_activation)
|
||||
menu->on_item_activation(event.menu.identifier);
|
||||
if (auto* action = menu->action_at(event.menu.identifier))
|
||||
action->activate();
|
||||
return;
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
|
||||
Reference in New Issue
Block a user