#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Thu, 30 Mar 2017 21:55:18 +0200
changeset 6138 094c0d355f5f
parent 6137 ede94cb05df9
child 6139 8c85b22e8722
#REFACTORING by stefan class: HorizontalPanelView changed: #preferredExtent
HorizontalPanelView.st
--- a/HorizontalPanelView.st	Sun Mar 19 10:10:56 2017 +0100
+++ b/HorizontalPanelView.st	Thu Mar 30 21:55:18 2017 +0200
@@ -1529,7 +1529,7 @@
     ].
 
     subViews := self subViewsToConsider.
-    (subViews size == 0) ifTrue:[
+    subViews isEmptyOrNil ifTrue:[
         ^ super preferredExtent.
         "/ ^ horizontalSpace @ verticalSpace].
     ].
@@ -1545,11 +1545,11 @@
 
         "/ better to use component's preferredExtent ...
 
+        childsPreference := child preferredExtent.
         child realized ifTrue:[
-            childsPreference := child extent max:child preferredExtent.
-        ] ifFalse:[
-            childsPreference := child preferredExtent.
+            childsPreference := childsPreference max:child extent.
         ].
+
         sumOfWidths := sumOfWidths + childsPreference x.
         maxHeight := maxHeight max:childsPreference y.
         maxWidth := maxWidth max:childsPreference x.
@@ -1565,8 +1565,8 @@
 "/    ].
 
     (hLayout == #fit 
-    or:[hLayout == #fitSpace
-    or:[hLayout endsWith:'Max']]) ifTrue:[
+     or:[hLayout == #fitSpace
+     or:[hLayout endsWith:'Max']]) ifTrue:[
         sumOfWidths := maxWidth * subViews size.
         self borderWidth ~~ 0 ifTrue:[
             sumOfWidths := sumOfWidths + (horizontalSpace * 2).
@@ -1587,12 +1587,12 @@
     ].
 
     ((vLayout == #topSpace) 
-    or:[vLayout == #bottomSpace]) ifTrue:[
+     or:[vLayout == #bottomSpace]) ifTrue:[
         maxHeight := maxHeight + verticalSpace
     ] ifFalse:[
         ((vLayout == #fitSpace) 
-        or:[vLayout == #center
-        or:[vLayout == #centerSpace]]) ifTrue:[
+         or:[vLayout == #center
+         or:[vLayout == #centerSpace]]) ifTrue:[
             maxHeight := maxHeight + (verticalSpace * 2)
         ]        
     ].
@@ -1600,7 +1600,8 @@
     m2 := margin * 2.
     ^ (sumOfWidths + m2) @ (maxHeight + m2)
 
-    "Modified: / 17.1.1998 / 00:18:38 / cg"
+    "Modified: / 17-01-1998 / 00:18:38 / cg"
+    "Modified (format): / 30-03-2017 / 18:38:09 / stefan"
 ! !
 
 !HorizontalPanelView class methodsFor:'documentation'!