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 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/gui/widgets/slider.cpp') 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) -- cgit v1.2.3-60-g2f50