diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-04 17:00:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-04 17:30:17 +0300 |
commit | 7a7f5905cf19f6a773dcf9bab762b54c16e325f2 (patch) | |
tree | 4c891cfaa2eadeecd0685782d8cf561c2a79dbf8 /src/gui/widgets/progressbar.h | |
parent | 0c7a1466e8c2c2dd6e15779368c87b62b2da601f (diff) | |
download | manaverse-7a7f5905cf19f6a773dcf9bab762b54c16e325f2.tar.gz manaverse-7a7f5905cf19f6a773dcf9bab762b54c16e325f2.tar.bz2 manaverse-7a7f5905cf19f6a773dcf9bab762b54c16e325f2.tar.xz manaverse-7a7f5905cf19f6a773dcf9bab762b54c16e325f2.zip |
Add support for padding in progress bars.
Also fixed progress bars size.
New progress bar attributes:
fillPadding - padding for will rectangle
padding - normal padding for bar
Diffstat (limited to 'src/gui/widgets/progressbar.h')
-rw-r--r-- | src/gui/widgets/progressbar.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h index e163fe66c..3b8b976cf 100644 --- a/src/gui/widgets/progressbar.h +++ b/src/gui/widgets/progressbar.h @@ -32,6 +32,7 @@ class Graphics; class GraphicsVertexes; class ImageRect; +class Skin; /** * A progress bar. @@ -120,23 +121,17 @@ class ProgressBar final : public gcn::Widget, public gcn::WidgetListener /** * Renders a progressbar with the given properties. */ - static void render(Graphics *graphics, const gcn::Rectangle &area, - const gcn::Color &color, const float progress, - const std::string &text, - GraphicsVertexes *const vert, bool *const redraw); - - /** - * Renders a progressbar with the given properties. - */ - static void render(Graphics *graphics, const gcn::Rectangle &area, - const gcn::Color &color, const float progress, - const std::string &text = ""); + void render(Graphics *graphics); void widgetResized(const gcn::Event &event) override; void widgetMoved(const gcn::Event &event) override; + void setPadding(unsigned int padding) + { mPadding = padding; } + private: + Skin *mSkin; float mProgress; float mProgressToGo; bool mSmoothProgress; @@ -149,8 +144,9 @@ class ProgressBar final : public gcn::Widget, public gcn::WidgetListener std::string mText; GraphicsVertexes *mVertexes; bool mRedraw; + unsigned int mPadding; + unsigned int mFillPadding; - static ImageRect mBorder; static int mInstances; static float mAlpha; |