|
@@ -3818,7 +3818,9 @@ void CanvasItemEditor::set_current_tool(Tool p_tool) {
|
|
}
|
|
}
|
|
|
|
|
|
void CanvasItemEditor::_update_editor_settings() {
|
|
void CanvasItemEditor::_update_editor_settings() {
|
|
|
|
+ button_center_view->set_icon(get_theme_icon(SNAME("CenterView"), SNAME("EditorIcons")));
|
|
select_button->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
|
select_button->set_icon(get_theme_icon(SNAME("ToolSelect"), SNAME("EditorIcons")));
|
|
|
|
+ select_sb->set_texture(get_theme_icon(SNAME("EditorRect2D"), SNAME("EditorIcons")));
|
|
list_select_button->set_icon(get_theme_icon(SNAME("ListSelect"), SNAME("EditorIcons")));
|
|
list_select_button->set_icon(get_theme_icon(SNAME("ListSelect"), SNAME("EditorIcons")));
|
|
move_button->set_icon(get_theme_icon(SNAME("ToolMove"), SNAME("EditorIcons")));
|
|
move_button->set_icon(get_theme_icon(SNAME("ToolMove"), SNAME("EditorIcons")));
|
|
scale_button->set_icon(get_theme_icon(SNAME("ToolScale"), SNAME("EditorIcons")));
|
|
scale_button->set_icon(get_theme_icon(SNAME("ToolScale"), SNAME("EditorIcons")));
|
|
@@ -3951,7 +3953,6 @@ void CanvasItemEditor::_notification(int p_what) {
|
|
} break;
|
|
} break;
|
|
|
|
|
|
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
|
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
|
- select_sb->set_texture(get_theme_icon(SNAME("EditorRect2D"), SNAME("EditorIcons")));
|
|
|
|
_update_editor_settings();
|
|
_update_editor_settings();
|
|
} break;
|
|
} break;
|
|
|
|
|
|
@@ -5052,8 +5053,17 @@ CanvasItemEditor::CanvasItemEditor() {
|
|
ED_SHORTCUT_ARRAY("canvas_item_editor/zoom_1600_percent", TTR("Zoom to 1600%"),
|
|
ED_SHORTCUT_ARRAY("canvas_item_editor/zoom_1600_percent", TTR("Zoom to 1600%"),
|
|
{ int32_t(Key::KEY_5), int32_t(Key::KP_5) });
|
|
{ int32_t(Key::KEY_5), int32_t(Key::KP_5) });
|
|
|
|
|
|
|
|
+ HBoxContainer *controls_hb = memnew(HBoxContainer);
|
|
|
|
+ controls_vb->add_child(controls_hb);
|
|
|
|
+
|
|
|
|
+ button_center_view = memnew(Button);
|
|
|
|
+ controls_hb->add_child(button_center_view);
|
|
|
|
+ button_center_view->set_flat(true);
|
|
|
|
+ button_center_view->set_tooltip_text(TTR("Center View"));
|
|
|
|
+ button_center_view->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(VIEW_CENTER_TO_SELECTION));
|
|
|
|
+
|
|
zoom_widget = memnew(EditorZoomWidget);
|
|
zoom_widget = memnew(EditorZoomWidget);
|
|
- controls_vb->add_child(zoom_widget);
|
|
|
|
|
|
+ controls_hb->add_child(zoom_widget);
|
|
zoom_widget->set_anchors_and_offsets_preset(Control::PRESET_TOP_LEFT, Control::PRESET_MODE_MINSIZE, 2 * EDSCALE);
|
|
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->set_shortcut_context(this);
|
|
zoom_widget->connect("zoom_changed", callable_mp(this, &CanvasItemEditor::_update_zoom));
|
|
zoom_widget->connect("zoom_changed", callable_mp(this, &CanvasItemEditor::_update_zoom));
|