diff options
Diffstat (limited to 'src/gui/widgets/button.h')
-rw-r--r-- | src/gui/widgets/button.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index 6d8f773c..7463d2ad 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -26,6 +26,7 @@ class ImageRect; class Image; +class TextPopup; /** * Button widget. Same as the Guichan button but with custom look. @@ -71,8 +72,18 @@ class Button : public gcn::Button * Standard, Highlighted, Pressed, and Disabled. * If the image is too short, the missing states won't be loaded. */ - void setButtonIcon(const std::string& iconFile = std::string(), - int frameHeight = 0, int frameWidth = 0); + bool setButtonIcon(const std::string& iconFile = std::string()); + + /** + * Set the button popup text when hovering it for a few seconds. + * + * @note: An empty text will disable the popup. + */ + void setButtonPopupText(const std::string& text = std::string()); + + void logic(); + void mouseMoved(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event); private: void init(); @@ -84,6 +95,9 @@ class Button : public gcn::Button static float mAlpha; Image** mButtonIcon; /**< Button Icons graphics */ + + static TextPopup* mTextPopup; /**< The buttons popup */ + std::string mPopupText; /**< the current button text */ }; #endif |