long overdue fix for BScrollBar. fValue is now set in SetValue()
instead of ValueChanged(). This fixes BScrollBar implementations which don't call the inherited version of ValueChanged(). All kinds of weird behaviour seems to be fixed by this: StyledEdit window resizing, scrolling in Pe, WonderBrush, eXposer and maybe more. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17263 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2005, Haiku, Inc.
|
* Copyright (c) 2001-2006, Haiku, Inc.
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -291,6 +291,7 @@ an actual BView within the scroll bar's window.
|
|||||||
void
|
void
|
||||||
BScrollBar::SetValue(float value)
|
BScrollBar::SetValue(float value)
|
||||||
{
|
{
|
||||||
|
//printf("BScrollBar::SetValue(%.1f)\n", value);
|
||||||
if (value == fValue)
|
if (value == fValue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -299,6 +300,12 @@ BScrollBar::SetValue(float value)
|
|||||||
if (value < fMin)
|
if (value < fMin)
|
||||||
value = fMin;
|
value = fMin;
|
||||||
|
|
||||||
|
fValue = value;
|
||||||
|
|
||||||
|
_UpdateThumbFrame();
|
||||||
|
_UpdateArrowButtons();
|
||||||
|
|
||||||
|
//printf(" -> calling ValueChanged()\n");
|
||||||
ValueChanged(value);
|
ValueChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,6 +320,7 @@ BScrollBar::Value() const
|
|||||||
void
|
void
|
||||||
BScrollBar::ValueChanged(float newValue)
|
BScrollBar::ValueChanged(float newValue)
|
||||||
{
|
{
|
||||||
|
printf("BScrollBar::ValueChanged(%.1f)\n", newValue);
|
||||||
if (fTarget) {
|
if (fTarget) {
|
||||||
// cache target bounds
|
// cache target bounds
|
||||||
BRect targetBounds = fTarget->Bounds();
|
BRect targetBounds = fTarget->Bounds();
|
||||||
@@ -326,10 +334,7 @@ BScrollBar::ValueChanged(float newValue)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fValue = newValue;
|
SetValue(newValue);
|
||||||
|
|
||||||
_UpdateThumbFrame();
|
|
||||||
_UpdateArrowButtons();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetProportion
|
// SetProportion
|
||||||
|
|||||||
Reference in New Issue
Block a user