#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Mon, 13 Feb 2017 18:13:48 +0100
changeset 5469 5bc43ecbfc54
parent 5468 2ca6776b4271
child 5470 a51a268786e7
#BUGFIX by cg class: MenuPanel ouch: a disabled, pressed button (indication) was not showing itself in disabled color.
MenuPanel.st
--- a/MenuPanel.st	Mon Feb 13 15:32:44 2017 +0100
+++ b/MenuPanel.st	Mon Feb 13 18:13:48 2017 +0100
@@ -7788,81 +7788,86 @@
     isSelected := self isSelected.
 
     isSelected ifFalse:[
-	"/ test whether button has pressed toggle behaviour
-	showSelected := (self isToggle and:[self indicationValue]).
+        "/ test whether button has pressed toggle behaviour
+        showSelected := (self isToggle and:[self indicationValue]).
     ] ifTrue:[
-	showSelected := isSelected
+        showSelected := isSelected
     ].
 
     showSelected ifTrue:[
-	bg := self activeBackgroundColor.
-	fg := self activeForegroundColor.
+        bg := self activeBackgroundColor.
+        fg := self activeForegroundColor.
+        isEnabled ifFalse:[
+            fg := menuPanel disabledForegroundColor.
+        ].    
     ] ifFalse:[
-	self isEntered ifTrue:[
-	    bg := self buttonEnteredBackgroundColor
-	] ifFalse:[
-	    bg := self backgroundColor
-	].
-	isEnabled ifTrue:[
-	    fg := menuPanel foregroundColor
-	] ifFalse:[
-	    fg := menuPanel disabledForegroundColor.
-	    etchFg := menuPanel disabledEtchedForegroundColor.
-	    drawObject := self disabledRawLabel
-	]
+        self isEntered ifTrue:[
+            bg := self buttonEnteredBackgroundColor
+        ] ifFalse:[
+            bg := self backgroundColor
+        ].
+        isEnabled ifTrue:[
+            fg := menuPanel foregroundColor
+        ] ifFalse:[
+            fg := menuPanel disabledForegroundColor.
+            etchFg := menuPanel disabledEtchedForegroundColor.
+            drawObject := self disabledRawLabel
+        ]
     ].
 
     (ownBgCol := self backgroundColorFromLabel) notNil ifTrue:[
-	bg := ownBgCol
+        bg := ownBgCol
     ].
 
     "DRAW BACKGROUND"
     bg ~= menuPanel backgroundColor ifTrue:[
-	menuPanel paint:bg.
-	menuPanel fillRectangle:layout.
+        menuPanel paint:bg.
+        menuPanel fillRectangle:layout.
     ].
 
     x := layout left + menuPanel buttonPassiveLevel + HorizontalButtonInset.
 
     (drawObject isImage and:[menuPanel centerItems]) ifTrue:[
-	x := x + (layout width - menuPanel buttonPassiveLevel - HorizontalButtonInset - 1 - drawObject width // 2).
+        x := x + (layout width - menuPanel buttonPassiveLevel - HorizontalButtonInset - 1 - drawObject width // 2).
     ].
 
     isSelected ifFalse:[
-	"check whether button should be drawn selected; indicator or radio button"
-
-	indication notNil ifTrue:[
-	    "button is indicator and set"
-	    isSelected := self indicationValue
-	] ifFalse:[
-	    isSelected := (choice notNil and:[choice value = menuItem choiceValue]).
-	]
+        "check whether button should be drawn selected; indicator or radio button"
+
+        indication notNil ifTrue:[
+            "button is indicator and set"
+            isSelected := self indicationValue
+        ] ifFalse:[
+            isSelected := (choice notNil and:[choice value = menuItem choiceValue]).
+        ]
     ].
     y := 0.
 
     isSelected ifTrue:[
-	level := menuPanel buttonActiveLevel.
-	x     := x + 1 "level abs".
-	y     := y + 1 "level abs".
+        level := menuPanel buttonActiveLevel.
+        x     := x + 1 "level abs".
+        y     := y + 1 "level abs".
     ] ifFalse:[
-	level := self isEntered ifTrue:[menuPanel buttonEnteredLevel]
-			       ifFalse:[menuPanel buttonPassiveLevel].
+        level := self isEntered ifTrue:[menuPanel buttonEnteredLevel]
+                               ifFalse:[menuPanel buttonPassiveLevel].
     ].
 
     drawObject notEmptyOrNil ifTrue:[
-	etchFg notNil ifTrue:[
-	    "/ donot draw images twice.. images are shown lightened
-	    drawObject isImageOrForm ifFalse:[
-		self drawRawLabel:drawObject atX:x+1 yOffset:y+1 paint:etchFg.
-	    ].
-	].
-	self drawRawLabel:drawObject atX:x yOffset:y+0 paint:fg.
+        etchFg notNil ifTrue:[
+            "/ donot draw images twice.. images are shown lightened
+            drawObject isImageOrForm ifFalse:[
+                self drawRawLabel:drawObject atX:x+1 yOffset:y+1 paint:etchFg.
+            ].
+        ].
+        self drawRawLabel:drawObject atX:x yOffset:y+0 paint:fg.
     ].
     self drawMenuIndicator.
 
     level ~~ 0 ifTrue:[
-	menuPanel drawButtonEdgesFor:self level:level
-    ].
+        menuPanel drawButtonEdgesFor:self level:level
+    ].
+
+    "Modified: / 13-02-2017 / 18:11:11 / cg"
 !
 
 drawLabel