Merge pull request #31978 from YeldhamDev/inspector_dock_small_improvements

Small improvements to the inspector dock
This commit is contained in:
Rémi Verschelde 2019-09-24 11:05:20 +02:00 committed by GitHub
commit 4a7889578c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -74,7 +74,12 @@ void EditorPath::_about_to_show() {
objects.clear(); objects.clear();
get_popup()->clear(); get_popup()->clear();
get_popup()->set_size(Size2(get_size().width, 1)); get_popup()->set_size(Size2(get_size().width, 1));
_add_children_to_popup(obj); _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() { void EditorPath::update_path() {

View file

@ -253,13 +253,11 @@ void InspectorDock::_prepare_history() {
text = obj->get_class(); text = obj->get_class();
} }
if (i == editor_history->get_history_pos()) { if (i == editor_history->get_history_pos() && current) {
text = "[" + text + "]"; text = "[" + text + "]";
} }
history_menu->get_popup()->add_icon_item(icon, text, i); history_menu->get_popup()->add_icon_item(icon, text, i);
} }
editor_path->update_path();
} }
void InspectorDock::_select_history(int p_idx) const { void InspectorDock::_select_history(int p_idx) const {
@ -296,7 +294,7 @@ void InspectorDock::_edit_forward() {
} }
void InspectorDock::_edit_back() { void InspectorDock::_edit_back() {
EditorHistory *editor_history = EditorNode::get_singleton()->get_editor_history(); 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(); editor->edit_current();
} }