From 65785bf7fd763207ca98bbe4a4b30fb4b05d6fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 13 Sep 2008 18:42:32 +0000 Subject: [PATCH] * Don't do anything in SetOrientation() if orientation is the same as the current one. * When calculating the thumb and bar frames, handle the case when the object doesn't have a label, but does have an update text. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27493 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Slider.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/Slider.cpp b/src/kits/interface/Slider.cpp index 730e107261..899553aea0 100644 --- a/src/kits/interface/Slider.cpp +++ b/src/kits/interface/Slider.cpp @@ -1177,7 +1177,7 @@ BSlider::BarFrame() const if (Orientation() == B_HORIZONTAL) { frame.left = thumbInset; - frame.top = 6.0 + (Label() ? textHeight + 4.0 : 0.0); + frame.top = 6.0 + (Label() || fUpdateText ? textHeight + 4.0 : 0.0); frame.right -= thumbInset; frame.bottom = frame.top + fBarThickness; } else { @@ -1241,7 +1241,7 @@ BSlider::ThumbFrame() const if (Orientation() == B_HORIZONTAL) { frame.left = floorf(Position() * (_MaxPosition() - _MinPosition()) + _MinPosition()) - 8; - frame.top = 2 + (Label() ? textHeight + 4 : 0); + frame.top = 2 + (Label() || fUpdateText ? textHeight + 4 : 0); frame.right = frame.left + 17; frame.bottom = frame.top + fBarThickness + 7; } else { @@ -1487,6 +1487,9 @@ BSlider::Orientation() const void BSlider::SetOrientation(orientation posture) { + if (fOrientation == posture) + return; + fOrientation = posture; InvalidateLayout(); Invalidate();