From b0c673265a73bcb5719986be589dfb10fee0ce22 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 3 Mar 2019 02:52:22 +0100 Subject: Applications: Map Alt+F4 to Quit in FileManager/ProcessManager/Terminal. --- LibGUI/GAction.cpp | 6 ++++++ LibGUI/GAction.h | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'LibGUI') diff --git a/LibGUI/GAction.cpp b/LibGUI/GAction.cpp index 27321c2ff4..770c5ebc5d 100644 --- a/LibGUI/GAction.cpp +++ b/LibGUI/GAction.cpp @@ -20,6 +20,12 @@ GAction::GAction(const String& text, RetainPtr&& icon, Function< { } +GAction::GAction(const String& text, const GShortcut& shortcut, Function on_activation_callback) + : GAction(text, shortcut, nullptr, move(on_activation_callback)) +{ +} + + GAction::GAction(const String& text, const GShortcut& shortcut, RetainPtr&& icon, Function on_activation_callback) : on_activation(move(on_activation_callback)) , m_text(text) diff --git a/LibGUI/GAction.h b/LibGUI/GAction.h index 959995d38b..f85cda11f0 100644 --- a/LibGUI/GAction.h +++ b/LibGUI/GAction.h @@ -21,6 +21,10 @@ public: { return adopt(*new GAction(text, move(icon), move(callback))); } + static Retained create(const String& text, const GShortcut& shortcut, Function callback) + { + return adopt(*new GAction(text, shortcut, move(callback))); + } static Retained create(const String& text, const GShortcut& shortcut, RetainPtr&& icon, Function callback) { return adopt(*new GAction(text, shortcut, move(icon), move(callback))); @@ -38,6 +42,7 @@ public: private: GAction(const String& text, Function = nullptr); + GAction(const String& text, const GShortcut&, Function = nullptr); GAction(const String& text, const GShortcut&, RetainPtr&& icon, Function = nullptr); GAction(const String& text, RetainPtr&& icon, Function = nullptr); GAction(const String& text, const String& custom_data = String(), Function = nullptr); -- cgit v1.2.3