diff --git a/Userland/Libraries/LibGUI/Action.cpp b/Userland/Libraries/LibGUI/Action.cpp index 5bedaecc43..46834b6201 100644 --- a/Userland/Libraries/LibGUI/Action.cpp +++ b/Userland/Libraries/LibGUI/Action.cpp @@ -41,9 +41,11 @@ namespace CommonActions { NonnullRefPtr make_about_action(const String& app_name, const Icon& app_icon, Window* parent) { auto weak_parent = AK::try_make_weak_ptr(parent); - return Action::create(String::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) { + auto action = Action::create(String::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) { AboutDialog::show(app_name, app_icon.bitmap_for_size(32), weak_parent.ptr()); }); + action->set_status_tip("Show application about box"); + return action; } NonnullRefPtr make_open_action(Function callback, Core::Object* parent) @@ -69,12 +71,16 @@ NonnullRefPtr make_save_as_action(Function callback, Core NonnullRefPtr make_move_to_front_action(Function 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); + auto action = 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); + action->set_status_tip("Move to the top of the stack"); + return action; } NonnullRefPtr make_move_to_back_action(Function callback, Core::Object* parent) { - return Action::create("Move to &Back", { Mod_Ctrl | Mod_Shift, Key_Down }, Gfx::Bitmap::load_from_file("/res/icons/16x16/move-to-back.png"), move(callback), parent); + auto action = Action::create("Move to &Back", { Mod_Ctrl | Mod_Shift, Key_Down }, Gfx::Bitmap::load_from_file("/res/icons/16x16/move-to-back.png"), move(callback), parent); + action->set_status_tip("Move to the bottom of the stack"); + return action; } NonnullRefPtr make_undo_action(Function callback, Core::Object* parent) @@ -94,42 +100,58 @@ NonnullRefPtr make_delete_action(Function callback, Core: NonnullRefPtr make_cut_action(Function callback, Core::Object* parent) { - return Action::create("Cu&t", { Mod_Ctrl, Key_X }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-cut.png"), move(callback), parent); + auto action = Action::create("Cu&t", { Mod_Ctrl, Key_X }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-cut.png"), move(callback), parent); + action->set_status_tip("Cut to clipboard"); + return action; } NonnullRefPtr make_copy_action(Function callback, Core::Object* parent) { - return Action::create("&Copy", { Mod_Ctrl, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"), move(callback), parent); + auto action = Action::create("&Copy", { Mod_Ctrl, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"), move(callback), parent); + action->set_status_tip("Copy to clipboard"); + return action; } NonnullRefPtr make_paste_action(Function callback, Core::Object* parent) { - return Action::create("&Paste", { Mod_Ctrl, Key_V }, Gfx::Bitmap::load_from_file("/res/icons/16x16/paste.png"), move(callback), parent); + auto action = Action::create("&Paste", { Mod_Ctrl, Key_V }, Gfx::Bitmap::load_from_file("/res/icons/16x16/paste.png"), move(callback), parent); + action->set_status_tip("Paste from clipboard"); + return action; } NonnullRefPtr make_fullscreen_action(Function callback, Core::Object* parent) { - return Action::create("&Fullscreen", { Mod_None, Key_F11 }, move(callback), parent); + auto action = Action::create("&Fullscreen", { Mod_None, Key_F11 }, move(callback), parent); + action->set_status_tip("Enter fullscreen mode"); + return action; } NonnullRefPtr make_quit_action(Function callback) { - return Action::create("&Quit", { Mod_Alt, Key_F4 }, move(callback)); + auto action = Action::create("&Quit", { Mod_Alt, Key_F4 }, move(callback)); + action->set_status_tip("Quit the application"); + return action; } NonnullRefPtr make_help_action(Function 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); + auto action = Action::create("&Contents", { Mod_None, Key_F1 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"), move(callback), parent); + action->set_status_tip("Show help contents"); + return action; } NonnullRefPtr make_go_back_action(Function 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); + auto action = Action::create("Go &Back", { Mod_Alt, Key_Left }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"), move(callback), parent); + action->set_status_tip("Move one step backward in history"); + return action; } NonnullRefPtr make_go_forward_action(Function callback, Core::Object* parent) { - return Action::create("Go &Forward", { Mod_Alt, Key_Right }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"), move(callback), parent); + auto action = Action::create("Go &Forward", { Mod_Alt, Key_Right }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"), move(callback), parent); + action->set_status_tip("Move one step forward in history"); + return action; } NonnullRefPtr make_go_home_action(Function callback, Core::Object* parent)