* When inside a layouted environment, InvalidateLayout() in MakeDefault()
instead of just resizing. * When the view thinks it knows the correct size, it needs to ResetLayoutInvalidation(). TODO: Actually all views that cache layout size info need to do this. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36214 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -429,8 +429,12 @@ BButton::MakeDefault(bool flag)
|
|||||||
if (!fDrawAsDefault) {
|
if (!fDrawAsDefault) {
|
||||||
fDrawAsDefault = true;
|
fDrawAsDefault = true;
|
||||||
|
|
||||||
ResizeBy(6.0f, 6.0f);
|
if ((Flags() & B_SUPPORTS_LAYOUT) != 0)
|
||||||
MoveBy(-3.0f, -3.0f);
|
InvalidateLayout();
|
||||||
|
else {
|
||||||
|
ResizeBy(6.0f, 6.0f);
|
||||||
|
MoveBy(-3.0f, -3.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window && oldDefault != this)
|
if (window && oldDefault != this)
|
||||||
@@ -441,8 +445,12 @@ BButton::MakeDefault(bool flag)
|
|||||||
|
|
||||||
fDrawAsDefault = false;
|
fDrawAsDefault = false;
|
||||||
|
|
||||||
ResizeBy(-6.0f, -6.0f);
|
if ((Flags() & B_SUPPORTS_LAYOUT) != 0)
|
||||||
MoveBy(3.0f, 3.0f);
|
InvalidateLayout();
|
||||||
|
else {
|
||||||
|
ResizeBy(-6.0f, -6.0f);
|
||||||
|
MoveBy(3.0f, 3.0f);
|
||||||
|
}
|
||||||
|
|
||||||
if (window && oldDefault == this)
|
if (window && oldDefault == this)
|
||||||
window->SetDefaultButton(NULL);
|
window->SetDefaultButton(NULL);
|
||||||
@@ -727,6 +735,8 @@ BButton::_ValidatePreferredSize()
|
|||||||
fPreferredSize.height
|
fPreferredSize.height
|
||||||
= ceilf((fontHeight.ascent + fontHeight.descent) * 1.8)
|
= ceilf((fontHeight.ascent + fontHeight.descent) * 1.8)
|
||||||
+ (fDrawAsDefault ? 6.0f : 0);
|
+ (fDrawAsDefault ? 6.0f : 0);
|
||||||
|
|
||||||
|
ResetLayoutInvalidation();
|
||||||
}
|
}
|
||||||
|
|
||||||
return fPreferredSize;
|
return fPreferredSize;
|
||||||
|
|||||||
Reference in New Issue
Block a user