* 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
This commit is contained in:
Stephan Aßmus
2008-09-13 18:42:32 +00:00
parent 2f464b193f
commit 65785bf7fd
+5 -2
View File
@@ -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();