From b19afea9427dde861c990236ab11e23edfeb267c Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 18 Jul 2020 14:49:13 +0200 Subject: Completed ui library tooltip implementation. --- src/ui/widget.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/ui/widget.h') diff --git a/src/ui/widget.h b/src/ui/widget.h index 243fdda..e1f199d 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -23,6 +23,8 @@ namespace ui { +class Tooltip; + class Widget { @@ -131,7 +133,7 @@ public: } /// widget tooltip - inline const std::string &tooltip() const { + inline Tooltip *tooltip() { return widget_tooltip; } @@ -249,11 +251,11 @@ public: /// set the widget's label void set_label(const char *label = nullptr); - /// set the wdiget's widget_tooltip - void set_tooltip(const std::string &tooltip); + /// set the wdiget's tooltip text + void set_tooltip(const std::string &tooltip_text); - /// set the wdiget's widget_tooltip - void set_tooltip(const char *tooltip = nullptr); + /// set the wdiget's tooltip text + void set_tooltip(const char *tooltip_text = nullptr); /// enable or disable widget border void set_border(const bool border = true); @@ -446,13 +448,14 @@ private: math::Vector2f widget_location; math::Vector2f widget_size; std::string widget_label; - std::string widget_tooltip; Children widget_children; const Palette *widget_palette; const Font *widget_font; Widget *widget_parent; + + Tooltip *widget_tooltip; Children::iterator find_child(Widget *child); -- cgit v1.2.3