LibGUI: Move rotate cw/ccw to CommonActions

The rotate clockwise/rotate counterclockwise actions can be added to
CommonActions since they are repeated in FontEditor, ImageViewer and
PixelPaint. This keeps the shortcuts and icons consistent across
applications.
This commit is contained in:
Marcus Nilsson 2022-01-03 11:19:05 +01:00 committed by Andreas Kling
commit cecbed467b
Notes: sideshowbarker 2024-07-17 21:32:20 +09:00
5 changed files with 30 additions and 18 deletions

View file

@ -48,6 +48,8 @@ NonnullRefPtr<Action> make_properties_action(Function<void(Action&)>, Core::Obje
NonnullRefPtr<Action> make_zoom_in_action(Function<void(Action&)>, Core::Object* parent = nullptr);
NonnullRefPtr<Action> make_zoom_out_action(Function<void(Action&)>, Core::Object* parent = nullptr);
NonnullRefPtr<Action> make_reset_zoom_action(Function<void(Action&)>, Core::Object* parent = nullptr);
NonnullRefPtr<Action> make_rotate_clockwise_action(Function<void(Action&)>, Core::Object* parent = nullptr);
NonnullRefPtr<Action> make_rotate_counterclockwise_action(Function<void(Action&)>, Core::Object* parent = nullptr);
};

View file

@ -178,6 +178,16 @@ NonnullRefPtr<Action> make_zoom_out_action(Function<void(Action&)> callback, Cor
return GUI::Action::create("Zoom &Out", { Mod_Ctrl, Key_Minus }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-out.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent);
}
NonnullRefPtr<Action> make_rotate_clockwise_action(Function<void(Action&)> callback, Core::Object* parent)
{
return GUI::Action::create("Rotate Clock&wise", { Mod_Ctrl | Mod_Shift, Key_X }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-cw.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent);
}
NonnullRefPtr<Action> make_rotate_counterclockwise_action(Function<void(Action&)> callback, Core::Object* parent)
{
return GUI::Action::create("Rotate &Counterclockwise", { Mod_Ctrl | Mod_Shift, Key_Z }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-ccw.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent);
}
}
}