diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-07-20 18:14:33 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-07-20 18:16:19 -0300 |
commit | 336db8bcd1ab9f08009efc58896510b66f5fe561 (patch) | |
tree | e549007e1c8c9278d1ed92af7520ed9194a78588 /scene/gui/control.cpp | |
parent | 002bacc01ffe3ace87c3880f76a2cadcc5650dda (diff) |
-Fix tooltips in inspector, now they show as rich text.
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r-- | scene/gui/control.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 068af42260..17c349858f 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2188,10 +2188,17 @@ void Control::set_tooltip(const String &p_tooltip) { data.tooltip = p_tooltip; } + String Control::get_tooltip(const Point2 &p_pos) const { return data.tooltip; } +Control *Control::make_custom_tooltip(const String &p_text) const { + if (get_script_instance()) { + return const_cast<Control *>(this)->call("_make_custom_tooltip", p_text); + } + return NULL; +} void Control::set_default_cursor_shape(CursorShape p_shape) { @@ -2820,6 +2827,7 @@ void Control::_bind_methods() { BIND_VMETHOD(MethodInfo(Variant::OBJECT, "get_drag_data", PropertyInfo(Variant::VECTOR2, "position"))); BIND_VMETHOD(MethodInfo(Variant::BOOL, "can_drop_data", PropertyInfo(Variant::VECTOR2, "position"), PropertyInfo(Variant::NIL, "data"))); BIND_VMETHOD(MethodInfo("drop_data", PropertyInfo(Variant::VECTOR2, "position"), PropertyInfo(Variant::NIL, "data"))); + BIND_VMETHOD(MethodInfo(Variant::OBJECT, "_make_custom_tooltip", PropertyInfo(Variant::STRING, "for_text"))); ADD_GROUP("Anchor", "anchor_"); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anchor_left", PROPERTY_HINT_RANGE, "0,1,0.01"), "_set_anchor", "get_anchor", MARGIN_LEFT); |