From 1da4e9e608728bca771964e23d0a72253dcb981c Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 29 Jul 2021 11:05:11 +0800 Subject: [PATCH] Hide open doc button when not inspecting anything (cherry picked from commit 80e4c8626d1ff648cf8ed1263cb24954f9fc1ccf) --- editor/inspector_dock.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 903da35f6a7..496e1febf5f 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -414,6 +414,7 @@ void InspectorDock::update(Object *p_object) { current = p_object; if (!p_object) { + open_docs_button->set_disabled(true); object_menu->set_disabled(true); warning->hide(); search->set_editable(false); @@ -429,7 +430,7 @@ void InspectorDock::update(Object *p_object) { editor_path->enable_path(); resource_save_button->set_disabled(!is_resource); - open_docs_button->set_visible(is_resource || is_node); + open_docs_button->set_disabled(!is_resource && !is_node); PopupMenu *resource_extra_popup = resource_extra_button->get_popup(); resource_extra_popup->set_item_disabled(resource_extra_popup->get_item_index(RESOURCE_COPY), !is_resource); @@ -570,7 +571,7 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { open_docs_button = memnew(Button); open_docs_button->set_flat(true); - open_docs_button->set_visible(false); + open_docs_button->set_disabled(true); open_docs_button->set_tooltip(TTR("Open documentation for this object.")); open_docs_button->set_icon(get_icon("HelpSearch", "EditorIcons")); open_docs_button->set_shortcut(ED_SHORTCUT("property_editor/open_help", TTR("Open Documentation")));