summaryrefslogtreecommitdiff
path: root/src/gui/widgets/slider.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-15 19:42:04 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-15 20:23:59 +0300
commit92da223a6a15298cd1a14c105a801ab0577670e1 (patch)
tree74067738d70017701f872624b8e730dd66b8f382 /src/gui/widgets/slider.cpp
parent649fdb1c512e9608aa05c99a08b867c8758eeaf8 (diff)
downloadplus-92da223a6a15298cd1a14c105a801ab0577670e1.tar.gz
plus-92da223a6a15298cd1a14c105a801ab0577670e1.tar.bz2
plus-92da223a6a15298cd1a14c105a801ab0577670e1.tar.xz
plus-92da223a6a15298cd1a14c105a801ab0577670e1.zip
improve slider.
Diffstat (limited to 'src/gui/widgets/slider.cpp')
-rw-r--r--src/gui/widgets/slider.cpp10
1 files changed, 4 insertions, 6 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)