From 38caa4ef918ef064f1b74fe9416b02fd517958c2 Mon Sep 17 00:00:00 2001 From: Zher Huei Lee Date: Fri, 14 Oct 2016 18:11:52 +0100 Subject: Added support for tooltips in ButtonArray. Fixes #6597 --- scene/gui/button_array.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scene/gui/button_array.h') diff --git a/scene/gui/button_array.h b/scene/gui/button_array.h index c4b9b0c9e3..62997a8e36 100644 --- a/scene/gui/button_array.h +++ b/scene/gui/button_array.h @@ -50,6 +50,7 @@ private: struct Button { String text; + String tooltip; Ref icon; mutable int _ms_cache; mutable int _pos_cache; @@ -78,14 +79,16 @@ public: void set_align(Align p_align); Align get_align() const; - void add_button(const String& p_button); - void add_icon_button(const Ref& p_icon,const String& p_button=""); + void add_button(const String& p_button,const String& p_tooltip=""); + void add_icon_button(const Ref& p_icon,const String& p_button="",const String& p_tooltip=""); void set_button_text(int p_button, const String& p_text); + void set_button_tooltip(int p_button, const String& p_text); void set_button_icon(int p_button, const Ref& p_icon); String get_button_text(int p_button) const; + String get_button_tooltip(int p_button) const; Ref get_button_icon(int p_button) const; int get_selected() const; @@ -100,6 +103,7 @@ public: virtual Size2 get_minimum_size() const; virtual void get_translatable_strings(List *p_strings) const; + virtual String get_tooltip(const Point2& p_pos) const; ButtonArray(Orientation p_orientation=HORIZONTAL); -- cgit v1.2.3