From e5f96a344ac5234c7a8116e5b8ac9feb67b02e22 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Wed, 4 Sep 2019 19:38:23 -0300 Subject: [PATCH] Small improvements to the inspector dock --- editor/editor_path.cpp | 5 +++++ editor/inspector_dock.cpp | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index 23d28261d1b..7f035b9968c 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -74,7 +74,12 @@ void EditorPath::_about_to_show() { objects.clear(); get_popup()->clear(); get_popup()->set_size(Size2(get_size().width, 1)); + _add_children_to_popup(obj); + if (get_popup()->get_item_count() == 0) { + get_popup()->add_item(TTR("No sub-resources found.")); + get_popup()->set_item_disabled(0, true); + } } void EditorPath::update_path() { diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 8ba7d9fba76..77b8e8dee92 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -253,13 +253,11 @@ void InspectorDock::_prepare_history() { text = obj->get_class(); } - if (i == editor_history->get_history_pos()) { + if (i == editor_history->get_history_pos() && current) { text = "[" + text + "]"; } history_menu->get_popup()->add_icon_item(icon, text, i); } - - editor_path->update_path(); } void InspectorDock::_select_history(int p_idx) const { @@ -296,7 +294,7 @@ void InspectorDock::_edit_forward() { } void InspectorDock::_edit_back() { EditorHistory *editor_history = EditorNode::get_singleton()->get_editor_history(); - if (editor_history->previous() || editor_history->get_path_size() == 1) + if ((current && editor_history->previous()) || editor_history->get_path_size() == 1) editor->edit_current(); }