summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-13 21:01:30 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-13 21:01:30 +0300
commitfb2224a7a2c7f7a80d4a4a948ee7c202fe56afac (patch)
treeb08ce592e1f63d22383c3739e3155f0aecf7c479 /src/gui/widgets
parent5b93d3755001f2770f0f72cb12074790025c6249 (diff)
downloadmanaplus-fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac.tar.gz
manaplus-fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac.tar.bz2
manaplus-fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac.tar.xz
manaplus-fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac.zip
improve progressbar.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/progressbar.cpp10
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;