diff options
author | Brendan Coles <bcoles@gmail.com> | 2021-01-02 08:10:48 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-02 11:43:25 +0100 |
commit | 69e3879b7a73f67d1e05c423e5afec830dc5ebbb (patch) | |
tree | c77da4a426338a01a111236e94dd1b2687b7688e /Libraries/LibGUI | |
parent | 7785d9715d9bc1b0c423a572eb40c6a86858ea1c (diff) | |
download | serenity-69e3879b7a73f67d1e05c423e5afec830dc5ebbb.zip |
LibGUI: CommonActions: Add make_help_action common action
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r-- | Libraries/LibGUI/Action.cpp | 5 | ||||
-rw-r--r-- | Libraries/LibGUI/Action.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGUI/Action.cpp b/Libraries/LibGUI/Action.cpp index fc98dce345..f71354fc5d 100644 --- a/Libraries/LibGUI/Action.cpp +++ b/Libraries/LibGUI/Action.cpp @@ -100,6 +100,11 @@ NonnullRefPtr<Action> make_quit_action(Function<void(Action&)> callback) return Action::create("Quit", { Mod_Alt, Key_F4 }, move(callback)); } +NonnullRefPtr<Action> make_help_action(Function<void(Action&)> callback, Core::Object* parent) +{ + return Action::create("Contents", { Mod_None, Key_F1 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"), move(callback), parent); +} + NonnullRefPtr<Action> make_go_back_action(Function<void(Action&)> callback, Core::Object* parent) { return Action::create("Go back", { Mod_Alt, Key_Left }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"), move(callback), parent); diff --git a/Libraries/LibGUI/Action.h b/Libraries/LibGUI/Action.h index b7a9d0d6ed..486aa6b999 100644 --- a/Libraries/LibGUI/Action.h +++ b/Libraries/LibGUI/Action.h @@ -55,6 +55,7 @@ NonnullRefPtr<Action> make_move_to_front_action(Function<void(Action&)>, Core::O NonnullRefPtr<Action> make_move_to_back_action(Function<void(Action&)>, Core::Object* parent = nullptr); NonnullRefPtr<Action> make_fullscreen_action(Function<void(Action&)>, Core::Object* parent = nullptr); NonnullRefPtr<Action> make_quit_action(Function<void(Action&)>); +NonnullRefPtr<Action> make_help_action(Function<void(Action&)>, Core::Object* parent = nullptr); NonnullRefPtr<Action> make_go_back_action(Function<void(Action&)>, Core::Object* parent = nullptr); NonnullRefPtr<Action> make_go_forward_action(Function<void(Action&)>, Core::Object* parent = nullptr); NonnullRefPtr<Action> make_go_home_action(Function<void(Action&)> callback, Core::Object* parent = nullptr); |