changed #preferredExtent - use explicitExtent instvar
authorStefan Vogel <sv@exept.de>
Sun, 26 Oct 2008 21:08:36 +0100
changeset 3752 9c3b292df738
parent 3751 8c607457ad94
child 3753 e56e38d631cd
changed #preferredExtent - use explicitExtent instvar
MenuView.st
--- a/MenuView.st	Sun Oct 26 21:08:24 2008 +0100
+++ b/MenuView.st	Sun Oct 26 21:08:36 2008 +0100
@@ -2519,10 +2519,14 @@
 
     |margin2 w h extra|
 
-    "/ If I have an explicit preferredExtent ..
-
+    "/ If I have an explicit preferredExtent..
+    explicitExtent notNil ifTrue:[
+        ^ explicitExtent
+    ].
+
+    "/ If I have a cached preferredExtent value..
     preferredExtent notNil ifTrue:[
-	^ preferredExtent
+        ^ preferredExtent
     ].
 
     widthOfWidestLine := nil.  "/ i.e. unknown
@@ -2531,16 +2535,16 @@
     w := self widthOfContents + leftMargin + leftMargin + margin2.
     h := (self numberOfLines) * fontHeight - lineSpacing + (2 * topMargin) + margin2.
     hilightLevel ~~ 0 ifTrue:[
-	h := h + (hilightLevel abs)
+        h := h + (hilightLevel abs)
     ].
 
     extra := 0.
     "if there is a submenu, add some space for the right arrow"
     subMenus notNil ifTrue:[
-	extra := 16
+        extra := 16
     ].
     ((ShowAcceleratorKeys ~~ false) and:[shortKeys notNil]) ifTrue:[
-	extra := extra max:(self shortKeyInset) + 10 "/ spacing
+        extra := extra max:(self shortKeyInset) + 10 "/ spacing
     ].
     ^ ((w+extra) @ h).
 
@@ -2904,5 +2908,5 @@
 !MenuView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.154 2008-02-05 14:17:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.155 2008-10-26 20:08:36 stefan Exp $'
 ! !