* 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:
parent
d2e28b603d
commit
a66b66ff5a
|
@ -429,8 +429,12 @@ BButton::MakeDefault(bool flag)
|
|||
if (!fDrawAsDefault) {
|
||||
fDrawAsDefault = true;
|
||||
|
||||
ResizeBy(6.0f, 6.0f);
|
||||
MoveBy(-3.0f, -3.0f);
|
||||
if ((Flags() & B_SUPPORTS_LAYOUT) != 0)
|
||||
InvalidateLayout();
|
||||
else {
|
||||
ResizeBy(6.0f, 6.0f);
|
||||
MoveBy(-3.0f, -3.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if (window && oldDefault != this)
|
||||
|
@ -441,8 +445,12 @@ BButton::MakeDefault(bool flag)
|
|||
|
||||
fDrawAsDefault = false;
|
||||
|
||||
ResizeBy(-6.0f, -6.0f);
|
||||
MoveBy(3.0f, 3.0f);
|
||||
if ((Flags() & B_SUPPORTS_LAYOUT) != 0)
|
||||
InvalidateLayout();
|
||||
else {
|
||||
ResizeBy(-6.0f, -6.0f);
|
||||
MoveBy(3.0f, 3.0f);
|
||||
}
|
||||
|
||||
if (window && oldDefault == this)
|
||||
window->SetDefaultButton(NULL);
|
||||
|
@ -727,6 +735,8 @@ BButton::_ValidatePreferredSize()
|
|||
fPreferredSize.height
|
||||
= ceilf((fontHeight.ascent + fontHeight.descent) * 1.8)
|
||||
+ (fDrawAsDefault ? 6.0f : 0);
|
||||
|
||||
ResetLayoutInvalidation();
|
||||
}
|
||||
|
||||
return fPreferredSize;
|
||||
|
|
Loading…
Reference in New Issue