class: Tools::LintRuleList
authorClaus Gittinger <cg@exept.de>
Sun, 01 Feb 2015 14:17:29 +0100
changeset 15151 c62aec5af315
parent 15150 940d37c7d3ac
child 15152 d5f4755c217b
class: Tools::LintRuleList 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.
Tools__LintRuleList.st
--- a/Tools__LintRuleList.st	Sun Feb 01 14:17:11 2015 +0100
+++ b/Tools__LintRuleList.st	Sun Feb 01 14:17:29 2015 +0100
@@ -814,6 +814,32 @@
     "Modified: / 08-10-2014 / 22:56:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+displayLabel:aLabel h:lH on:aGC x:newX y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
+    | cx icon app mode |
+
+    cx := x := newX.
+    app := self application.
+    mode := app mode.
+    mode ~~ #display ifTrue:[
+        mode == #select ifTrue:[        
+            icon := self checked 
+                        ifTrue:[app class checkedIcon] 
+                        ifFalse:[app class uncheckedIcon].
+        ] ifFalse:[ 
+            icon := self checked 
+                        ifTrue:[app class checkedIconDisabled] 
+                        ifFalse:[app class uncheckedIconDisabled].
+        ].
+        icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2).
+        cx := cx + 22."experimental value - this looks good"
+    ].
+
+    super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
+
+    "Modified (format): / 07-03-2012 / 20:08:02 / cg"
+    "Modified: / 08-10-2014 / 22:56:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 displayOn:aGCOrStream
 
     "/ what a kludge - Dolphin and Squeak mean: printOn: a stream;
@@ -831,14 +857,14 @@
 !LintRuleList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleList.st,v 1.27 2014-12-03 18:04:31 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleList.st,v 1.28 2015-02-01 13:17:29 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleList.st,v 1.27 2014-12-03 18:04:31 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleList.st,v 1.28 2015-02-01 13:17:29 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: Tools__LintRuleList.st,v 1.27 2014-12-03 18:04:31 cg Exp $'
+    ^ '$Id: Tools__LintRuleList.st,v 1.28 2015-02-01 13:17:29 cg Exp $'
 ! !