mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
PixelPaint: Use GUI::CommonActions for zoom related actions
This commit is contained in:
parent
55dead60b5
commit
c6b44e215a
1 changed files with 14 additions and 9 deletions
|
@ -199,23 +199,28 @@ int main(int argc, char** argv)
|
||||||
edit_menu.add_action(redo_action);
|
edit_menu.add_action(redo_action);
|
||||||
|
|
||||||
auto& view_menu = menubar->add_menu("&View");
|
auto& view_menu = menubar->add_menu("&View");
|
||||||
view_menu.add_action(GUI::Action::create(
|
|
||||||
"Zoom &In", { Mod_Ctrl, Key_Equal }, [&](auto&) {
|
auto zoom_in_action = GUI::CommonActions::make_zoom_in_action(
|
||||||
|
[&](auto&) {
|
||||||
image_editor.scale_by(0.1f);
|
image_editor.scale_by(0.1f);
|
||||||
},
|
},
|
||||||
window));
|
window);
|
||||||
|
|
||||||
view_menu.add_action(GUI::Action::create(
|
auto zoom_out_action = GUI::CommonActions::make_zoom_out_action(
|
||||||
"Zoom &Out", { Mod_Ctrl, Key_Minus }, [&](auto&) {
|
[&](auto&) {
|
||||||
image_editor.scale_by(-0.1f);
|
image_editor.scale_by(-0.1f);
|
||||||
},
|
},
|
||||||
window));
|
window);
|
||||||
|
|
||||||
view_menu.add_action(GUI::Action::create(
|
auto reset_zoom_action = GUI::CommonActions::make_reset_zoom_action(
|
||||||
"&Reset Zoom", { Mod_Ctrl, Key_0 }, [&](auto&) {
|
[&](auto&) {
|
||||||
image_editor.reset_scale_and_position();
|
image_editor.reset_scale_and_position();
|
||||||
},
|
},
|
||||||
window));
|
window);
|
||||||
|
|
||||||
|
view_menu.add_action(zoom_in_action);
|
||||||
|
view_menu.add_action(zoom_out_action);
|
||||||
|
view_menu.add_action(reset_zoom_action);
|
||||||
|
|
||||||
auto& tool_menu = menubar->add_menu("&Tool");
|
auto& tool_menu = menubar->add_menu("&Tool");
|
||||||
toolbox.for_each_tool([&](auto& tool) {
|
toolbox.for_each_tool([&](auto& tool) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue