summaryrefslogtreecommitdiff
path: root/editor/inspector_dock.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-29 09:57:33 +0200
committerGitHub <noreply@github.com>2021-07-29 09:57:33 +0200
commit5ece1bd1360f2a3849e7ff493d6aee53bc502a3e (patch)
tree6effea16666ebb326a5dac9659c2840849c1e6e3 /editor/inspector_dock.cpp
parent48857194b360dabdaac7cd4c9c6714546ca15aa1 (diff)
parent80e4c8626d1ff648cf8ed1263cb24954f9fc1ccf (diff)
Merge pull request #50994 from timothyqiu/open-docs-button
Disable open doc button when not inspecting anything
Diffstat (limited to 'editor/inspector_dock.cpp')
-rw-r--r--editor/inspector_dock.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 1973494a2a..a566afb597 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -409,6 +409,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);
@@ -424,7 +425,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);
@@ -575,7 +576,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_theme_icon(SNAME("HelpSearch"), SNAME("EditorIcons")));
open_docs_button->set_shortcut(ED_SHORTCUT("property_editor/open_help", TTR("Open Documentation")));