mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-30 03:20:28 +00:00
PixelPaint: Use GUI::CommonActions for zoom related actions
This commit is contained in:
parent
55dead60b5
commit
c6b44e215a
Notes:
sideshowbarker
2024-07-18 18:05:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c6b44e215a9
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);
|
||||
|
||||
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);
|
||||
},
|
||||
window));
|
||||
window);
|
||||
|
||||
view_menu.add_action(GUI::Action::create(
|
||||
"Zoom &Out", { Mod_Ctrl, Key_Minus }, [&](auto&) {
|
||||
auto zoom_out_action = GUI::CommonActions::make_zoom_out_action(
|
||||
[&](auto&) {
|
||||
image_editor.scale_by(-0.1f);
|
||||
},
|
||||
window));
|
||||
window);
|
||||
|
||||
view_menu.add_action(GUI::Action::create(
|
||||
"&Reset Zoom", { Mod_Ctrl, Key_0 }, [&](auto&) {
|
||||
auto reset_zoom_action = GUI::CommonActions::make_reset_zoom_action(
|
||||
[&](auto&) {
|
||||
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");
|
||||
toolbox.for_each_tool([&](auto& tool) {
|
||||
|
|
Loading…
Reference in a new issue