diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_inspector.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 18 | ||||
-rw-r--r-- | editor/editor_spin_slider.cpp | 8 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 15 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | editor/scene_tree_editor.cpp | 3 |
6 files changed, 39 insertions, 8 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 74b874b54e..9b03731fd8 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2436,10 +2436,10 @@ void EditorInspector::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", callable_mp(this, &EditorInspector::_feature_profile_changed)); set_process(is_visible_in_tree()); + _update_inspector_bg(); } if (p_what == NOTIFICATION_ENTER_TREE) { - _update_inspector_bg(); if (!sub_inspector) { get_tree()->connect("node_removed", callable_mp(this, &EditorInspector::_node_removed)); } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 4c23ada5e9..c3e15f2840 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1089,13 +1089,23 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String file->clear_filters(); List<String> preferred; - for (int i = 0; i < extensions.size(); i++) { - if (p_resource->is_class("Script") && (extensions[i] == "tres" || extensions[i] == "res" || extensions[i] == "xml")) { + for (List<String>::Element *E = extensions.front(); E; E = E->next()) { + if (p_resource->is_class("Script") && (E->get() == "tres" || E->get() == "res")) { //this serves no purpose and confused people continue; } - file->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper()); - preferred.push_back(extensions[i]); + file->add_filter("*." + E->get() + " ; " + E->get().to_upper()); + preferred.push_back(E->get()); + } + // Lowest priority extension + List<String>::Element *res_element = preferred.find("res"); + if (res_element) { + preferred.move_to_back(res_element); + } + // Highest priority extension + List<String>::Element *tres_element = preferred.find("tres"); + if (tres_element) { + preferred.move_to_front(tres_element); } if (p_at_path != String()) { diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 618d953c56..bbabc08ea4 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -175,7 +175,9 @@ void EditorSpinSlider::_grabber_gui_input(const Ref<InputEvent> &p_event) { return; } - float grabbing_ofs = (grabber->get_transform().xform(mm->get_position()).x - grabbing_from) / float(grabber_range); + float scale_x = get_global_transform_with_canvas().get_scale().x; + ERR_FAIL_COND(Math::is_zero_approx(scale_x)); + float grabbing_ofs = (grabber->get_transform().xform(mm->get_position()).x - grabbing_from) / float(grabber_range) / scale_x; set_as_ratio(grabbing_ratio + grabbing_ofs); update(); } @@ -300,8 +302,10 @@ void EditorSpinSlider::_notification(int p_what) { grabber->set_texture(grabber_tex); } + Vector2 scale = get_global_transform_with_canvas().get_scale(); + grabber->set_scale(scale); grabber->set_size(Size2(0, 0)); - grabber->set_position(get_global_position() + grabber_rect.position + grabber_rect.size * 0.5 - grabber->get_size() * 0.5); + grabber->set_position(get_global_position() + (grabber_rect.position + grabber_rect.size * 0.5 - grabber->get_size() * 0.5) * scale); if (mousewheel_over_grabber) { Input::get_singleton()->warp_mouse_position(grabber->get_position() + grabber_rect.size); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index ab5fd30998..43bfccc656 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2718,7 +2718,22 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { // `KEY_MASK_CMD | KEY_C` conflicts with other editor shortcuts. ED_SHORTCUT("filesystem_dock/copy_path", TTR("Copy Path"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_C); ED_SHORTCUT("filesystem_dock/duplicate", TTR("Duplicate..."), KEY_MASK_CMD | KEY_D); + +#if defined(WINDOWS_ENABLED) + // TRANSLATORS: This string is only used on Windows, as it refers to the system trash + // as "Recycle Bin" instead of "Trash". Make sure to use the translation of "Recycle Bin" + // recommended by Microsoft for the target language. + ED_SHORTCUT("filesystem_dock/delete", TTR("Move to Recycle Bin"), KEY_DELETE); +#elif defined(OSX_ENABLED) + // TRANSLATORS: This string is only used on macOS, as it refers to the system trash + // as "Bin" instead of "Trash". Make sure to use the translation of "Bin" + // recommended by Apple for the target language. + ED_SHORTCUT("filesystem_dock/delete", TTR("Move to Bin"), KEY_DELETE); +#else + // TRANSLATORS: This string is only used on platforms other than Windows and macOS. ED_SHORTCUT("filesystem_dock/delete", TTR("Move to Trash"), KEY_DELETE); +#endif + ED_SHORTCUT("filesystem_dock/rename", TTR("Rename..."), KEY_F2); VBoxContainer *top_vbc = memnew(VBoxContainer); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index bac6f3cd79..23467c8377 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2622,6 +2622,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { bool CanvasItemEditor::_gui_input_ruler_tool(const Ref<InputEvent> &p_event) { if (tool != TOOL_RULER) { + ruler_tool_active = false; return false; } diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 2d739202fb..e9de91f851 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -626,7 +626,7 @@ void SceneTreeEditor::_selected_changed() { } void SceneTreeEditor::_deselect_items() { - // Clear currently elected items in scene tree dock. + // Clear currently selected items in scene tree dock. if (editor_selection) { editor_selection->clear(); emit_signal("node_changed"); @@ -1172,6 +1172,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope tree->set_anchor(SIDE_BOTTOM, ANCHOR_END); tree->set_begin(Point2(0, p_label ? 18 : 0)); tree->set_end(Point2(0, 0)); + tree->set_allow_reselect(true); tree->add_theme_constant_override("button_margin", 0); add_child(tree); |