mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibGUI: Add some more status tips to common actions
This commit is contained in:
parent
a2086ad56e
commit
7ceb4f5330
1 changed files with 33 additions and 11 deletions
|
@ -41,9 +41,11 @@ namespace CommonActions {
|
|||
NonnullRefPtr<Action> make_about_action(const String& app_name, const Icon& app_icon, Window* parent)
|
||||
{
|
||||
auto weak_parent = AK::try_make_weak_ptr<Window>(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<Action> make_open_action(Function<void(Action&)> callback, Core::Object* parent)
|
||||
|
@ -69,12 +71,16 @@ NonnullRefPtr<Action> make_save_as_action(Function<void(Action&)> callback, Core
|
|||
|
||||
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);
|
||||
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<Action> make_move_to_back_action(Function<void(Action&)> 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<Action> make_undo_action(Function<void(Action&)> callback, Core::Object* parent)
|
||||
|
@ -94,42 +100,58 @@ NonnullRefPtr<Action> make_delete_action(Function<void(Action&)> callback, Core:
|
|||
|
||||
NonnullRefPtr<Action> make_cut_action(Function<void(Action&)> 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<Action> make_copy_action(Function<void(Action&)> 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<Action> make_paste_action(Function<void(Action&)> 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<Action> make_fullscreen_action(Function<void(Action&)> 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<Action> make_quit_action(Function<void(Action&)> 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<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);
|
||||
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<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);
|
||||
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<Action> make_go_forward_action(Function<void(Action&)> 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<Action> make_go_home_action(Function<void(Action&)> callback, Core::Object* parent)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue