summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorEric M <itsjusteza@gmail.com>2022-03-24 23:03:43 +1000
committerEric M <itsjusteza@gmail.com>2022-09-24 18:24:59 +1000
commit16a3cec71ee2b4a52b1440caa9fa1f9af6a1bf9f (patch)
tree917687f124588a1f0dd6f3565f7291bb34aedad8 /editor/plugins
parentf74491fdee9bc2d68668137fbacd8f3a7e7e8df7 (diff)
Fix zoom in/out keyboard shortcuts not working since the introduction of EditorZoomWidget. Add KP shortcuts to zoom in/out.
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp1
-rw-r--r--editor/plugins/tiles/tile_atlas_view.cpp2
-rw-r--r--editor/plugins/tiles/tile_data_editors.cpp1
3 files changed, 3 insertions, 1 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 8dc08e3a93..8b25c9afb7 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5058,6 +5058,7 @@ CanvasItemEditor::CanvasItemEditor() {
zoom_widget = memnew(EditorZoomWidget);
controls_vb->add_child(zoom_widget);
zoom_widget->set_anchors_and_offsets_preset(Control::PRESET_TOP_LEFT, Control::PRESET_MODE_MINSIZE, 2 * EDSCALE);
+ zoom_widget->set_shortcut_context(this);
zoom_widget->connect("zoom_changed", callable_mp(this, &CanvasItemEditor::_update_zoom));
panner.instantiate();
diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp
index c823487279..502c34459a 100644
--- a/editor/plugins/tiles/tile_atlas_view.cpp
+++ b/editor/plugins/tiles/tile_atlas_view.cpp
@@ -533,11 +533,11 @@ TileAtlasView::TileAtlasView() {
panel->set_v_size_flags(SIZE_EXPAND_FILL);
add_child(panel);
- // Scrollingsc
zoom_widget = memnew(EditorZoomWidget);
add_child(zoom_widget);
zoom_widget->set_anchors_and_offsets_preset(Control::PRESET_TOP_LEFT, Control::PRESET_MODE_MINSIZE, 2 * EDSCALE);
zoom_widget->connect("zoom_changed", callable_mp(this, &TileAtlasView::_zoom_widget_changed).unbind(1));
+ zoom_widget->set_shortcut_context(this);
button_center_view = memnew(Button);
button_center_view->set_icon(get_theme_icon(SNAME("CenterView"), SNAME("EditorIcons")));
diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp
index 4d54001b94..fb13436d81 100644
--- a/editor/plugins/tiles/tile_data_editors.cpp
+++ b/editor/plugins/tiles/tile_data_editors.cpp
@@ -831,6 +831,7 @@ GenericTilePolygonEditor::GenericTilePolygonEditor() {
editor_zoom_widget = memnew(EditorZoomWidget);
editor_zoom_widget->set_position(Vector2(5, 5));
editor_zoom_widget->connect("zoom_changed", callable_mp(this, &GenericTilePolygonEditor::_zoom_changed).unbind(1));
+ editor_zoom_widget->set_shortcut_context(this);
root->add_child(editor_zoom_widget);
button_center_view = memnew(Button);