#TUNING by cg
class: SelectionInListModelView
changed:
#drawLabelAt:x:y:h:
#drawSelectionFrameAt:x:w:
draw by sending messages to gc instead of self.
(new GC structure)
--- a/SelectionInListModelView.st Tue Jan 24 23:15:21 2017 +0100
+++ b/SelectionInListModelView.st Tue Jan 24 23:19:08 2017 +0100
@@ -994,20 +994,20 @@
(highlightMode notNil and:[self isInSelection:anIndex]) ifTrue:[
strikeOut ifTrue:[
drawStrikeOut := true.
- self paint:fgColor on:bgColor
+ gc paint:fgColor on:bgColor
] ifFalse:[
(highlightMode == #dropMode or:[self hasFocus not]) ifTrue:[
- self paint:hilightFgColorNoFocus on:hilightBgColorNoFocus.
+ gc paint:hilightFgColorNoFocus on:hilightBgColorNoFocus.
] ifFalse:[
- self paint:hilightFgColor on:hilightBgColor
+ gc paint:hilightFgColor on:hilightBgColor
].
isHighlightedAsSelected := true.
]
] ifFalse:[
enterItem == item ifTrue:[
- self paint:hilightBgColor on:bgColor.
+ gc paint:hilightBgColor on:bgColor.
] ifFalse:[
- self paint:fgColor on:bgColor.
+ gc paint:fgColor on:bgColor.
].
].
listRenderer display:item atX:x y:y lineHeight:h isHighlightedAsSelected:isHighlightedAsSelected.
@@ -1020,18 +1020,18 @@
xOut1 := width - margin.
].
y0 := y + (h // 2).
- self displayLineFromX:xOut0 y:y0 toX:xOut1 y:y0.
+ gc displayLineFromX:xOut0 y:y0 toX:xOut1 y:y0.
y0 := y0 - 1.
- self displayLineFromX:xOut0 y:y0 toX:xOut1 y:y0.
+ gc displayLineFromX:xOut0 y:y0 toX:xOut1 y:y0.
].
cursorItem == item ifTrue:[
"/ textStartLeft
- self maskOrigin:((self viewOrigin + (0 @ 1)) \\ (lineMask extent)).
- self mask:lineMask.
+ gc maskOrigin:((self viewOrigin + (0 @ 1)) \\ (lineMask extent)).
+ gc mask:lineMask.
w := listRenderer widthFor:item.
- self displayRectangleX:x -1 y:(y+2) width:w+2 height:(h - 4).
- self mask:nil.
+ gc displayRectangleX:x -1 y:(y+2) width:w+2 height:(h - 4).
+ gc mask:nil.
] ifFalse:[
enterItem == item ifTrue:[
self highlightWithUnderline ifTrue:[
@@ -1039,7 +1039,7 @@
y0 := y + h - 2.
x1 := x + (listRenderer widthFor:item).
- self displayLineFromX:x y:y0 toX:x1 y:y0.
+ gc displayLineFromX:x y:y0 toX:x1 y:y0.
]
].
].
@@ -1093,38 +1093,38 @@
xRgtDmg > xLftDmg ifFalse:[^ self].
(highlightMode == #dropMode or:[self hasFocus not]) ifTrue:[
- self paint:hilightBgColorNoFocus.
+ gc paint:hilightBgColorNoFocus.
] ifFalse:[
- self paint:hilightBgColor.
+ gc paint:hilightBgColor.
].
- self fillRectangleX:xLftDmg y:y0 width:(xRgtDmg - xLftDmg) height:hL.
+ gc fillRectangleX:xLftDmg y:y0 width:(xRgtDmg - xLftDmg) height:hL.
wL := x1 - x0.
"/ DRAW THE FRAME
hilightFrameColor notNil ifTrue:[
hilightLevel == 0 ifTrue:[
- self paint:hilightFrameColor.
+ gc paint:hilightFrameColor.
highlightMode == #line ifTrue:[
- self displayLineFromX:x0 y:y0 toX:x1 y:y0.
+ gc displayLineFromX:x0 y:y0 toX:x1 y:y0.
y1 := y0 + hL - 1.
- self displayLineFromX:x0 y:y1 toX:x1 y:y1.
+ gc displayLineFromX:x0 y:y1 toX:x1 y:y1.
] ifFalse:[
- self displayRectangleX:x0 y:y0 width:wL height:hL
+ gc displayRectangleX:x0 y:y0 width:wL height:hL
].
^ self.
]
] ifFalse:[
hilightStyle == #motif ifTrue:[
- self paint:bgColor.
+ gc paint:bgColor.
y1 := y0 + 1.
highlightMode == #line ifTrue:[
- self displayLineFromX:x0 y:y1 toX:x1 y:y1.
+ gc displayLineFromX:x0 y:y1 toX:x1 y:y1.
y1 := y0 + hL - 2.
- self displayLineFromX:x0 y:y1 toX:x1 y:y1.
+ gc displayLineFromX:x0 y:y1 toX:x1 y:y1.
] ifFalse:[
- self displayRectangleX:x0 + 1 y:y1 width:wL - 2 height:hL - 2
+ gc displayRectangleX:x0 + 1 y:y1 width:wL - 2 height:hL - 2
]
].
hilightLevel == 0 ifTrue:[ ^ self ].