From fb2224a7a2c7f7a80d4a4a948ee7c202fe56afac Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 13 Jun 2013 21:01:30 +0300 Subject: improve progressbar. --- src/gui/widgets/progressbar.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/gui') 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; -- cgit v1.2.3-70-g09d2