From 211cd1e46a9e9e39ce3c026583830bc778a4bed0 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Fri, 26 Aug 2022 17:12:46 +0300 Subject: [PATCH] Remove Inspector tooltip hack that never actually worked --- doc/classes/EditorProperty.xml | 6 ------ editor/editor_inspector.cpp | 16 ---------------- editor/editor_inspector.h | 8 -------- scene/main/viewport.cpp | 2 -- 4 files changed, 32 deletions(-) diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index d6dc30bd8..8923e06d6 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -37,12 +37,6 @@ Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin.parse_property]), then this will return the property. - - - - Must be implemented to provide a custom tooltip to the property editor. - - diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 8ab5b896e..a8ff482f5 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -710,7 +710,6 @@ void EditorProperty::_update_pin_flags() { } Control *EditorProperty::make_custom_tooltip(const String &p_text) const { - tooltip_text = p_text; EditorHelpBit *help_bit = memnew(EditorHelpBit); help_bit->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel")); help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE); @@ -732,10 +731,6 @@ Control *EditorProperty::make_custom_tooltip(const String &p_text) const { return help_bit; } -String EditorProperty::get_tooltip_text() const { - return tooltip_text; -} - void EditorProperty::_bind_methods() { ClassDB::bind_method(D_METHOD("set_label", "text"), &EditorProperty::set_label); ClassDB::bind_method(D_METHOD("get_label"), &EditorProperty::get_label); @@ -763,8 +758,6 @@ void EditorProperty::_bind_methods() { ClassDB::bind_method(D_METHOD("_unhandled_key_input"), &EditorProperty::_unhandled_key_input); ClassDB::bind_method(D_METHOD("_focusable_focused"), &EditorProperty::_focusable_focused); - ClassDB::bind_method(D_METHOD("get_tooltip_text"), &EditorProperty::get_tooltip_text); - ClassDB::bind_method(D_METHOD("add_focusable", "control"), &EditorProperty::add_focusable); ClassDB::bind_method(D_METHOD("set_bottom_editor", "editor"), &EditorProperty::set_bottom_editor); @@ -990,7 +983,6 @@ void EditorInspectorCategory::_notification(int p_what) { } Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) const { - tooltip_text = p_text; EditorHelpBit *help_bit = memnew(EditorHelpBit); help_bit->add_theme_style_override("panel", get_theme_stylebox("panel", "TooltipPanel")); help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE); @@ -1026,14 +1018,6 @@ Size2 EditorInspectorCategory::get_minimum_size() const { return ms; } -void EditorInspectorCategory::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_tooltip_text"), &EditorInspectorCategory::get_tooltip_text); -} - -String EditorInspectorCategory::get_tooltip_text() const { - return tooltip_text; -} - EditorInspectorCategory::EditorInspectorCategory() { } diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 31cd03246..206ff81a5 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -130,8 +130,6 @@ private: Control *bottom_editor; PopupMenu *menu; - mutable String tooltip_text; - void _update_pin_flags(); protected: @@ -197,8 +195,6 @@ public: void set_object_and_property(Object *p_object, const StringName &p_property); virtual Control *make_custom_tooltip(const String &p_text) const; - String get_tooltip_text() const; - void set_draw_top_bg(bool p_draw) { draw_top_bg = p_draw; } bool can_revert_to_default() const { return can_revert; } @@ -240,18 +236,14 @@ class EditorInspectorCategory : public Control { Ref icon; String label; Color bg_color; - mutable String tooltip_text; protected: void _notification(int p_what); - static void _bind_methods(); public: virtual Size2 get_minimum_size() const; virtual Control *make_custom_tooltip(const String &p_text) const; - String get_tooltip_text() const; - EditorInspectorCategory(); }; diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index e7a194bb5..e67fbf5ea 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2144,8 +2144,6 @@ void Viewport::_gui_input_event(Ref p_event) { if (tooltip == gui.tooltip_label->get_text()) { is_tooltip_shown = true; } - } else if (tooltip == String(gui.tooltip_popup->call("get_tooltip_text"))) { - is_tooltip_shown = true; } } else { _gui_cancel_tooltip();