diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-15 19:42:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-15 20:23:59 +0300 |
commit | 92da223a6a15298cd1a14c105a801ab0577670e1 (patch) | |
tree | 74067738d70017701f872624b8e730dd66b8f382 /src/gui | |
parent | 649fdb1c512e9608aa05c99a08b867c8758eeaf8 (diff) | |
download | manaplus-92da223a6a15298cd1a14c105a801ab0577670e1.tar.gz manaplus-92da223a6a15298cd1a14c105a801ab0577670e1.tar.bz2 manaplus-92da223a6a15298cd1a14c105a801ab0577670e1.tar.xz manaplus-92da223a6a15298cd1a14c105a801ab0577670e1.zip |
improve slider.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/slider.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/slider.h | 2 |
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 |