Remove Inspector tooltip hack that never actually worked

This commit is contained in:
Yuri Sizov 2022-08-26 17:12:46 +03:00
parent 320fe64d8c
commit 72d1156286
4 changed files with 0 additions and 32 deletions

View File

@ -38,12 +38,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. Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin.parse_property]), then this will return the property.
</description> </description>
</method> </method>
<method name="get_tooltip_text" qualifiers="const">
<return type="String" />
<description>
Must be implemented to provide a custom tooltip to the property editor.
</description>
</method>
<method name="set_bottom_editor"> <method name="set_bottom_editor">
<return type="void" /> <return type="void" />
<argument index="0" name="editor" type="Control" /> <argument index="0" name="editor" type="Control" />

View File

@ -699,7 +699,6 @@ void EditorProperty::_update_pin_flags() {
} }
Control *EditorProperty::make_custom_tooltip(const String &p_text) const { Control *EditorProperty::make_custom_tooltip(const String &p_text) const {
tooltip_text = p_text;
EditorHelpBit *help_bit = memnew(EditorHelpBit); EditorHelpBit *help_bit = memnew(EditorHelpBit);
help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel")); help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel"));
help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE); help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE);
@ -721,10 +720,6 @@ Control *EditorProperty::make_custom_tooltip(const String &p_text) const {
return help_bit; return help_bit;
} }
String EditorProperty::get_tooltip_text() const {
return tooltip_text;
}
void EditorProperty::_bind_methods() { void EditorProperty::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_label", "text"), &EditorProperty::set_label); ClassDB::bind_method(D_METHOD("set_label", "text"), &EditorProperty::set_label);
ClassDB::bind_method(D_METHOD("get_label"), &EditorProperty::get_label); ClassDB::bind_method(D_METHOD("get_label"), &EditorProperty::get_label);
@ -752,8 +747,6 @@ void EditorProperty::_bind_methods() {
ClassDB::bind_method(D_METHOD("_unhandled_key_input"), &EditorProperty::_unhandled_key_input); 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("_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("add_focusable", "control"), &EditorProperty::add_focusable);
ClassDB::bind_method(D_METHOD("set_bottom_editor", "editor"), &EditorProperty::set_bottom_editor); ClassDB::bind_method(D_METHOD("set_bottom_editor", "editor"), &EditorProperty::set_bottom_editor);
@ -979,7 +972,6 @@ void EditorInspectorCategory::_notification(int p_what) {
} }
Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) const { Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) const {
tooltip_text = p_text;
EditorHelpBit *help_bit = memnew(EditorHelpBit); EditorHelpBit *help_bit = memnew(EditorHelpBit);
help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel")); help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel"));
help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE); help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE);
@ -1015,14 +1007,6 @@ Size2 EditorInspectorCategory::get_minimum_size() const {
return ms; 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() { EditorInspectorCategory::EditorInspectorCategory() {
} }

View File

@ -108,8 +108,6 @@ private:
Control *bottom_editor; Control *bottom_editor;
PopupMenu *menu; PopupMenu *menu;
mutable String tooltip_text;
void _update_pin_flags(); void _update_pin_flags();
protected: protected:
@ -175,8 +173,6 @@ public:
void set_object_and_property(Object *p_object, const StringName &p_property); void set_object_and_property(Object *p_object, const StringName &p_property);
virtual Control *make_custom_tooltip(const String &p_text) const; 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; } void set_draw_top_bg(bool p_draw) { draw_top_bg = p_draw; }
bool can_revert_to_default() const { return can_revert; } bool can_revert_to_default() const { return can_revert; }
@ -218,18 +214,14 @@ class EditorInspectorCategory : public Control {
Ref<Texture> icon; Ref<Texture> icon;
String label; String label;
Color bg_color; Color bg_color;
mutable String tooltip_text;
protected: protected:
void _notification(int p_what); void _notification(int p_what);
static void _bind_methods();
public: public:
virtual Size2 get_minimum_size() const; virtual Size2 get_minimum_size() const;
virtual Control *make_custom_tooltip(const String &p_text) const; virtual Control *make_custom_tooltip(const String &p_text) const;
String get_tooltip_text() const;
EditorInspectorCategory(); EditorInspectorCategory();
}; };

View File

@ -2236,8 +2236,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
if (tooltip == gui.tooltip_label->get_text()) { if (tooltip == gui.tooltip_label->get_text()) {
is_tooltip_shown = true; is_tooltip_shown = true;
} }
} else if (tooltip == String(gui.tooltip_popup->call("get_tooltip_text"))) {
is_tooltip_shown = true;
} }
} else { } else {
_gui_cancel_tooltip(); _gui_cancel_tooltip();