diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-06 15:41:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-06 15:41:27 +0300 |
commit | 893df56fe05fb0e865fda77477c37200bbab018b (patch) | |
tree | 8922c463869a9b5486609d1bec7b1bda28f8c88b /src/gui/widgets/progressbar.h | |
parent | d4841f5ec6d954bce7f628a33b8394550e32a057 (diff) | |
download | plus-893df56fe05fb0e865fda77477c37200bbab018b.tar.gz plus-893df56fe05fb0e865fda77477c37200bbab018b.tar.bz2 plus-893df56fe05fb0e865fda77477c37200bbab018b.tar.xz plus-893df56fe05fb0e865fda77477c37200bbab018b.zip |
Use cached image for drawing text in progressbar.
Diffstat (limited to 'src/gui/widgets/progressbar.h')
-rw-r--r-- | src/gui/widgets/progressbar.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h index f9a5f1e62..120569795 100644 --- a/src/gui/widgets/progressbar.h +++ b/src/gui/widgets/progressbar.h @@ -23,6 +23,8 @@ #ifndef GUI_WIDGETS_PROGRESSBAR_H #define GUI_WIDGETS_PROGRESSBAR_H +#include "gui/fonts/textchunk.h" + #include "gui/widgets/widget.h" #include "listeners/widgetlistener.h" @@ -108,8 +110,7 @@ class ProgressBar final : public Widget, /** * Sets the text shown on the progress bar. */ - void setText(const std::string &str) - { mText = str; } + void setText(const std::string &str); /** * Returns the text shown on the progress bar. @@ -133,11 +134,14 @@ class ProgressBar final : public Widget, void widgetMoved(const Event &event) override final; + void widgetHidden(const Event &event) override final; + void setPadding(unsigned int padding) { mPadding = padding; } private: ImageRect mFillRect; + TextChunk mTextChunk; Skin *mSkin; float mProgress; float mProgressToGo; @@ -156,6 +160,7 @@ class ProgressBar final : public Widget, bool mFillImage; bool mSmoothProgress; bool mSmoothColorChange; + bool mTextChanged; }; #endif // GUI_WIDGETS_PROGRESSBAR_H |