summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2019-09-04 19:38:23 -0300
committerMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2019-09-04 19:42:44 -0300
commite5f96a344ac5234c7a8116e5b8ac9feb67b02e22 (patch)
treea7a930569ace35f5608d9fb8479bc683ea82d8db /editor
parente205cbbd06deb02eff579469fa420ac25dc0688f (diff)
Small improvements to the inspector dock
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_path.cpp5
-rw-r--r--editor/inspector_dock.cpp6
2 files changed, 7 insertions, 4 deletions
diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp
index 23d28261d1..7f035b9968 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 8ba7d9fba7..77b8e8dee9 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();
}