From 893df56fe05fb0e865fda77477c37200bbab018b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 6 Sep 2015 15:41:27 +0300 Subject: Use cached image for drawing text in progressbar. --- src/gui/widgets/progressbar.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gui/widgets/progressbar.h') 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 -- cgit v1.2.3-60-g2f50