From 92da223a6a15298cd1a14c105a801ab0577670e1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 15 Jun 2013 19:42:04 +0300 Subject: improve slider. --- src/gui/widgets/slider.cpp | 10 ++++------ src/gui/widgets/slider.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/gui/widgets') 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)->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 -- cgit v1.2.3-70-g09d2