summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorHüseyin ASLITÜRK <asliturk@hotmail.com>2020-05-27 16:53:57 +0300
committerAndreas Kling <kling@serenityos.org>2020-06-03 21:52:40 +0200
commiteead3878a152587783e49bc54e05134bdd7e281d (patch)
tree39ba1a817826aa5c2094f07cb1b3541cf52d0467 /Libraries
parent8e9776165f4e14fcd77e93e49148d977db214f79 (diff)
downloadserenity-eead3878a152587783e49bc54e05134bdd7e281d.zip
LibGUI: Add save action to CommonActions list
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/Action.cpp5
-rw-r--r--Libraries/LibGUI/Action.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGUI/Action.cpp b/Libraries/LibGUI/Action.cpp
index b103514df2..c0f279e6ba 100644
--- a/Libraries/LibGUI/Action.cpp
+++ b/Libraries/LibGUI/Action.cpp
@@ -39,6 +39,11 @@ NonnullRefPtr<Action> make_open_action(Function<void(Action&)> callback, Core::O
return Action::create("Open...", { Mod_Ctrl, Key_O }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"), move(callback), parent);
}
+NonnullRefPtr<Action> make_save_action(Function<void(Action&)> callback, Core::Object* parent)
+{
+ return Action::create("Save", { Mod_Ctrl, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"), move(callback), parent);
+}
+
NonnullRefPtr<Action> make_move_to_front_action(Function<void(Action&)> callback, Core::Object* parent)
{
return Action::create("Move to front", { Mod_Ctrl | Mod_Shift, Key_Up }, Gfx::Bitmap::load_from_file("/res/icons/16x16/move-to-front.png"), move(callback), parent);
diff --git a/Libraries/LibGUI/Action.h b/Libraries/LibGUI/Action.h
index 7197cae669..5e2e6321f4 100644
--- a/Libraries/LibGUI/Action.h
+++ b/Libraries/LibGUI/Action.h
@@ -43,6 +43,7 @@ namespace GUI {
namespace CommonActions {
NonnullRefPtr<Action> make_open_action(Function<void(Action&)>, Core::Object* parent = nullptr);
+ NonnullRefPtr<Action> make_save_action(Function<void(Action&)>, Core::Object* parent = nullptr);
NonnullRefPtr<Action> make_undo_action(Function<void(Action&)>, Core::Object* parent = nullptr);
NonnullRefPtr<Action> make_redo_action(Function<void(Action&)>, Core::Object* parent = nullptr);
NonnullRefPtr<Action> make_cut_action(Function<void(Action&)>, Core::Object* parent = nullptr);