summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;