ListView.st
branchjv
changeset 5386 26b17b83a19b
parent 5221 d036f1df0408
parent 5372 4dd658134d1d
child 5395 fc9336b15c5c
--- a/ListView.st	Mon Jun 22 18:16:14 2015 +0100
+++ b/ListView.st	Tue Jul 28 17:31:58 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -11,6 +13,8 @@
 "
 "{ Package: 'stx:libwidg' }"
 
+"{ NameSpace: Smalltalk }"
+
 View subclass:#ListView
 	instanceVariableNames:'list firstLineShown nFullLinesShown nLinesShown fgColor bgColor
 		partialLines leftMargin topMargin textStartLeft textStartTop
@@ -1954,14 +1958,19 @@
      given x position in fg/bg. Clears the whole line before drawing the string.
      This is a low level entry; not meant for public use."
 
-    |y l|
+    |y l halfSpacing extraBelow|
 
     y := self yOfVisibleLine:visLineNr.
     backgroundAlreadyClearedColor == bg ifFalse:[
         self paint:bg.
-        self fillRectangleX:margin y:y - (lineSpacing//2)
+        halfSpacing := (lineSpacing//2).
+        extraBelow := 0.
+        self highlightLineSpacing ifTrue:[
+            extraBelow := halfSpacing.
+        ].
+        self fillRectangleX:margin y:y - halfSpacing
                       width:(width - (2 * margin))
-                     height:fontHeight.
+                     height:fontHeight+extraBelow.
     ].
     line notNil ifTrue:[
         self paint:fg on:bg.
@@ -1975,7 +1984,7 @@
             l := line
         ].
         self displayOpaqueString:l x:x y:(y + fontAscent)
-    ]
+    ].
 
     "Modified: / 15.12.1999 / 23:19:46 / cg"
 !
@@ -2938,6 +2947,14 @@
     ].
 !
 
+highlightLineSpacing
+    "true if the spacing between lines is to be drawn with selected color,
+     false if it remains white.
+     false for selection in list views; true for edit/text views"
+
+    ^ true
+!
+
 line:line withoutEmphasis:emphasisToRemove
     (line notNil
     and:[line isString]) ifTrue:[
@@ -4517,7 +4534,7 @@
             y1 := 0.
         ].
 
-        inv := (margin@y1) extent:(w@y0).
+        inv := (margin@y1) extent:(w@y0+margin).
     ] ifFalse:[
         "/ scrolling horizontal
 
@@ -5310,10 +5327,10 @@
 !ListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.401 2014-12-08 17:31:05 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.401 2014-12-08 17:31:05 cg Exp $'
+    ^ '$Header$'
 ! !