From 16a3cec71ee2b4a52b1440caa9fa1f9af6a1bf9f Mon Sep 17 00:00:00 2001 From: Eric M Date: Thu, 24 Mar 2022 23:03:43 +1000 Subject: Fix zoom in/out keyboard shortcuts not working since the introduction of EditorZoomWidget. Add KP shortcuts to zoom in/out. --- editor/plugins/canvas_item_editor_plugin.cpp | 1 + editor/plugins/tiles/tile_atlas_view.cpp | 2 +- editor/plugins/tiles/tile_data_editors.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'editor/plugins') 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); -- cgit v1.2.3