mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
GCommonActions: Add "Open..." action
Make use of this in PaintBrush and TextEditor. :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 12:02:52 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/74c4e626599
@@ -6,6 +6,11 @@
|
||||
|
||||
namespace GCommonActions {
|
||||
|
||||
NonnullRefPtr<GAction> make_open_action(Function<void(GAction&)> callback, GWidget* widget)
|
||||
{
|
||||
return GAction::create("Open...", { Mod_Ctrl, Key_O }, GraphicsBitmap::load_from_file("/res/icons/16x16/open.png"), move(callback), widget);
|
||||
}
|
||||
|
||||
NonnullRefPtr<GAction> make_move_to_front_action(Function<void(GAction&)> callback, GWidget* widget)
|
||||
{
|
||||
return GAction::create("Move to front", { Mod_Ctrl | Mod_Shift, Key_Up }, GraphicsBitmap::load_from_file("/res/icons/16x16/move-to-front.png"), move(callback), widget);
|
||||
|
||||
@@ -19,6 +19,7 @@ class GMenuItem;
|
||||
class GWidget;
|
||||
|
||||
namespace GCommonActions {
|
||||
NonnullRefPtr<GAction> make_open_action(Function<void(GAction&)>, GWidget* widget = nullptr);
|
||||
NonnullRefPtr<GAction> make_undo_action(Function<void(GAction&)>, GWidget* widget = nullptr);
|
||||
NonnullRefPtr<GAction> make_redo_action(Function<void(GAction&)>, GWidget* widget = nullptr);
|
||||
NonnullRefPtr<GAction> make_cut_action(Function<void(GAction&)>, GWidget* widget = nullptr);
|
||||
|
||||
Reference in New Issue
Block a user