when changing a layoutContainer
authorClaus Gittinger <cg@exept.de>
Fri, 08 Oct 1999 17:12:31 +0200
changeset 1252 f886528c2b35
parent 1251 379bd54db35b
child 1253 9b66c237df0a
when changing a layoutContainer back from a fit to a non-fit layout, care for components with defaultExtent (i.e. let them resize). Otherwise their size remains as fitted
UIPainterView.st
--- a/UIPainterView.st	Wed Oct 06 14:32:45 1999 +0200
+++ b/UIPainterView.st	Fri Oct 08 17:12:31 1999 +0200
@@ -1675,6 +1675,26 @@
         ].
     ].
 
+    aSpec class isLayoutContainer ifTrue:[
+        "/ TODO:
+        "/ go through subviews and let them resize to their default/preferred
+        "/ needed if we change a containers layout from fit to non-fit.
+
+        aView subViews do:[:aSubView |
+            |fix spec prop|
+
+            (prop := self propertyOfView:aSubView) notNil ifTrue:[
+                spec := prop spec.
+
+                spec useDefaultExtent ifTrue:[
+                    fix := aSubView sizeFixed:false.
+                    aSubView extent:aSubView preferredExtent.
+                    aSubView sizeFixed:fix
+                ]
+            ]
+        ].
+    ].
+
     aSpec needsRebuildForAttributes ifTrue:[
         "/ needs a full rebuild (in case view class depends upon spec-attribute)
         v := aSpec buildViewWithLayoutFor:builder in:(self findContainerOfView:aView).