summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-27 22:45:55 +0200
committerGitHub <noreply@github.com>2022-05-27 22:45:55 +0200
commit1f690f197a4fb0809afb2f59bf78e4d3d89fd847 (patch)
tree5b5c22f48fc1c51d016cb46e12d8b78744bb3ce8 /editor
parent8a21f7231f0851aec4c06abee28a549b1f8083fd (diff)
parentc2bf9c28026719620e205c2564413787e1703221 (diff)
Merge pull request #61264 from KoBeWi/zoom_reset_begone
Remove zoom_reset shortcut in 2D editor
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_zoom_widget.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
2 files changed, 2 insertions, 4 deletions
diff --git a/editor/editor_zoom_widget.cpp b/editor/editor_zoom_widget.cpp
index c8099c9a0b..e4beea5e5f 100644
--- a/editor/editor_zoom_widget.cpp
+++ b/editor/editor_zoom_widget.cpp
@@ -178,7 +178,7 @@ EditorZoomWidget::EditorZoomWidget() {
zoom_reset->add_theme_color_override("font_outline_color", Color(0, 0, 0));
zoom_reset->add_theme_color_override("font_color", Color(1, 1, 1));
zoom_reset->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_reset));
- zoom_reset->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", TTR("Zoom Reset"), KeyModifierMask::CMD | Key::KEY_0));
+ zoom_reset->set_shortcut(ED_GET_SHORTCUT("canvas_item_editor/zoom_100_percent"));
zoom_reset->set_shortcut_context(this);
zoom_reset->set_focus_mode(FOCUS_NONE);
zoom_reset->set_text_alignment(HORIZONTAL_ALIGNMENT_CENTER);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index a7e3d17fdc..d28629b41a 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5295,14 +5295,12 @@ CanvasItemEditor::CanvasItemEditor() {
// To ensure that scripts can parse the list of shortcuts correctly, we have to define
// those shortcuts one by one.
- // Resetting zoom to 100% is a duplicate shortcut of `canvas_item_editor/reset_zoom`,
- // but it ensures both 1 and Ctrl + 0 can be used to reset zoom.
ED_SHORTCUT("canvas_item_editor/zoom_3.125_percent", TTR("Zoom to 3.125%"), KeyModifierMask::SHIFT | Key::KEY_5);
ED_SHORTCUT("canvas_item_editor/zoom_6.25_percent", TTR("Zoom to 6.25%"), KeyModifierMask::SHIFT | Key::KEY_4);
ED_SHORTCUT("canvas_item_editor/zoom_12.5_percent", TTR("Zoom to 12.5%"), KeyModifierMask::SHIFT | Key::KEY_3);
ED_SHORTCUT("canvas_item_editor/zoom_25_percent", TTR("Zoom to 25%"), KeyModifierMask::SHIFT | Key::KEY_2);
ED_SHORTCUT("canvas_item_editor/zoom_50_percent", TTR("Zoom to 50%"), KeyModifierMask::SHIFT | Key::KEY_1);
- ED_SHORTCUT("canvas_item_editor/zoom_100_percent", TTR("Zoom to 100%"), Key::KEY_1);
+ ED_SHORTCUT_ARRAY("canvas_item_editor/zoom_100_percent", TTR("Zoom to 100%"), { (int32_t)Key::KEY_1, (int32_t)(KeyModifierMask::CMD | Key::KEY_0) });
ED_SHORTCUT("canvas_item_editor/zoom_200_percent", TTR("Zoom to 200%"), Key::KEY_2);
ED_SHORTCUT("canvas_item_editor/zoom_400_percent", TTR("Zoom to 400%"), Key::KEY_3);
ED_SHORTCUT("canvas_item_editor/zoom_800_percent", TTR("Zoom to 800%"), Key::KEY_4);