Author: stippi Date: 2010-04-13 15:19:49 +0200 (Tue, 13 Apr 2010) New Revision: 36214 Changeset: http://dev.haiku-os.org/changeset/36214/haiku Modified: haiku/trunk/src/kits/interface/Button.cpp Log: * 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. Modified: haiku/trunk/src/kits/interface/Button.cpp =================================================================== --- haiku/trunk/src/kits/interface/Button.cpp 2010-04-13 13:14:10 UTC (rev 36213) +++ haiku/trunk/src/kits/interface/Button.cpp 2010-04-13 13:19:49 UTC (rev 36214) @@ -429,8 +429,12 @@ 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 @@ 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 @@ fPreferredSize.height = ceilf((fontHeight.ascent + fontHeight.descent) * 1.8) + (fDrawAsDefault ? 6.0f : 0); + + ResetLayoutInvalidation(); } return fPreferredSize;