summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/slider.cpp10
-rw-r--r--src/gui/widgets/slider.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index 6e523c4ed..e8ea8ea25 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -77,13 +77,11 @@ void Slider::init()
// Load resources
if (mInstances == 0)
{
- if (Theme::instance())
+ Theme *const theme = Theme::instance();
+ if (theme)
{
for (int mode = 0; mode < 2; mode ++)
- {
- Theme::instance()->loadRect(buttons[mode],
- data[mode], "slider.xml", 0, 8);
- }
+ theme->loadRect(buttons[mode], data[mode], "slider.xml", 0, 8);
}
updateAlpha();
}
@@ -190,7 +188,7 @@ void Slider::drawMarker(gcn::Graphics *const graphics) const
return;
static_cast<Graphics*>(graphics)->drawImage(img, getMarkerPosition(),
- (getHeight() - img->getHeight()) / 2);
+ (mDimension.height - img->getHeight()) / 2);
}
void Slider::mouseEntered(gcn::MouseEvent& event A_UNUSED)
diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h
index 0adb05291..cd5cacd35 100644
--- a/src/gui/widgets/slider.h
+++ b/src/gui/widgets/slider.h
@@ -105,9 +105,9 @@ class Slider final : public gcn::Slider,
void init();
static ImageRect buttons[2];
- bool mHasMouse;
static float mAlpha;
static int mInstances;
+ bool mHasMouse;
};
#endif // GUI_WIDGETS_SLIDER_H