diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-13 21:01:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-13 21:01:30 +0300 |
commit | fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac (patch) | |
tree | b08ce592e1f63d22383c3739e3155f0aecf7c479 /src/gui/widgets/progressbar.cpp | |
parent | 5b93d3755001f2770f0f72cb12074790025c6249 (diff) | |
download | manaplus-fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac.tar.gz manaplus-fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac.tar.bz2 manaplus-fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac.tar.xz manaplus-fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac.zip |
improve progressbar.
Diffstat (limited to 'src/gui/widgets/progressbar.cpp')
-rw-r--r-- | src/gui/widgets/progressbar.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 7d0041706..caaec19b0 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -67,9 +67,10 @@ ProgressBar::ProgressBar(const Widget2 *const widget, float progress, addWidgetListener(this); setSize(width, height); - if (Theme::instance()) + Theme *const theme = Theme::instance(); + if (theme) { - mSkin = Theme::instance()->load("progressbar.xml", ""); + mSkin = theme->load("progressbar.xml", ""); setPadding(mSkin->getPadding()); mFillPadding = mSkin->getOption("fillPadding"); setHeight(2 * mPadding + getFont()->getHeight() + 2); @@ -86,8 +87,9 @@ ProgressBar::~ProgressBar() mInstances--; if (mSkin) { - if (Theme::instance()) - Theme::instance()->unload(mSkin); + Theme *const theme = Theme::instance(); + if (theme) + theme->unload(mSkin); mSkin = nullptr; } delete mVertexes; |