summaryrefslogtreecommitdiff
path: root/src/gui/widgets/progressbar.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-06 15:41:27 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-06 15:41:27 +0300
commit893df56fe05fb0e865fda77477c37200bbab018b (patch)
tree8922c463869a9b5486609d1bec7b1bda28f8c88b /src/gui/widgets/progressbar.h
parentd4841f5ec6d954bce7f628a33b8394550e32a057 (diff)
downloadmv-893df56fe05fb0e865fda77477c37200bbab018b.tar.gz
mv-893df56fe05fb0e865fda77477c37200bbab018b.tar.bz2
mv-893df56fe05fb0e865fda77477c37200bbab018b.tar.xz
mv-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.h9
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