class: MenuEditor
authorClaus Gittinger <cg@exept.de>
Sun, 01 Feb 2015 14:16:33 +0100
changeset 3178 58100b56595d
parent 3177 0d5fbdb2e7fd
child 3179 174a9f51db76
class: MenuEditor fixed the following redraw bug in ModelListView (which is already fixed in SelectionInListView): if a colored item is shown with selection, the color attribute should be removed (or relaxed), to avoid drawing the label invisible. I.e. if the text color is blue or grey, and the selection bg is blue. we should draw white-on-blue, instead of blue/grey on blue. For this to work, the info whether drawing a selection must be passed down through the renderer to the item's draw routine.
MenuEditor.st
--- a/MenuEditor.st	Sat Jan 31 13:55:04 2015 +0100
+++ b/MenuEditor.st	Sun Feb 01 14:16:33 2015 +0100
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libtool2' }"
 
+"{ NameSpace: Smalltalk }"
+
 ResourceSpecEditor subclass:#MenuEditor
 	instanceVariableNames:'selectionHolder tabHolder listOfItems listOfTabs
 		selectedSuperItems notifyDisabledCounter wizards listOfItemsView
@@ -3927,15 +3929,15 @@
     ^ menuItem rawLabel
 !
 
-displayOn:aGC x:x y:y h:h
-    "display the item in the graphicsContext, aGC.
-    "
+displayOn:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
+    "display the item in the graphicsContext, aGC"
+
     |label|
 
     label := self displayLabel.
 
     label notNil ifTrue:[
-	self displayLabel:label h:(self heightOn:aGC) on:aGC x:x y:y h:h
+        self displayLabel:label h:(self heightOn:aGC) on:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
     ].
 !
 
@@ -6393,9 +6395,9 @@
 
 !MenuEditor::SeparatorItem methodsFor:'displaying'!
 
-displayOn:aGC x:x y:y h:h
-    "draw the receiver in the graphicsContext, aGC.
-    "
+displayOn:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
+    "draw the receiver in the graphicsContext, aGC"
+
     |x1 y0 type|
 
     type := self separatorType.
@@ -6405,9 +6407,9 @@
     y0 := y + (h // 2) - 1.
 
     type == #double ifTrue:[
-	y0 := y0 + 1.
-	aGC displayLineFromX:x y:y0 toX:x1 y:y0.
-	y0 := y0 - 2
+        y0 := y0 + 1.
+        aGC displayLineFromX:x y:y0 toX:x1 y:y0.
+        y0 := y0 - 2
     ].
     aGC displayLineFromX:x y:y0 toX:x1 y:y0
 !