mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
LibGUI: Move shortcut actions from GEventLoop to GApplications.
I'm gonna want to have nested event loops sooner or later, so let's not pollute GEventLoop with things that are meant to work globally. This patch also changes key events to pass around their modifiers as a bitfield all the way around the system instead of breaking them up.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GEventLoop.h>
|
||||
#include <LibGUI/GApplication.h>
|
||||
|
||||
GAction::GAction(const String& text, const String& custom_data, Function<void(const GAction&)> on_activation_callback)
|
||||
: on_activation(move(on_activation_callback))
|
||||
@@ -32,13 +32,13 @@ GAction::GAction(const String& text, const GShortcut& shortcut, RetainPtr<Graphi
|
||||
, m_icon(move(icon))
|
||||
, m_shortcut(shortcut)
|
||||
{
|
||||
GEventLoop::register_action_with_shortcut(Badge<GAction>(), *this);
|
||||
GApplication::the().register_shortcut_action(Badge<GAction>(), *this);
|
||||
}
|
||||
|
||||
GAction::~GAction()
|
||||
{
|
||||
if (m_shortcut.is_valid())
|
||||
GEventLoop::unregister_action_with_shortcut(Badge<GAction>(), *this);
|
||||
GApplication::the().unregister_shortcut_action(Badge<GAction>(), *this);
|
||||
}
|
||||
|
||||
void GAction::activate()
|
||||
|
||||
Reference in New Issue
Block a user