SelectionInListModelView.st
changeset 6201 f62406ae4f1e
parent 6167 8106bb36e30e
--- a/SelectionInListModelView.st	Wed Dec 18 19:08:13 2019 +0100
+++ b/SelectionInListModelView.st	Thu Dec 19 20:12:46 2019 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1999 by eXept Software AG
 	      All Rights Reserved
@@ -28,7 +26,7 @@
 	classVariableNames:'DefaultHilightStyle DefaultHilightBackgroundColor
 		DefaultHilightForegroundColor DefaultHilightLevel
 		DefaultHilightFrameColor DefaultHilightBackgroundColorNoFocus
-		DefaultHilightForegroundColorNoFocus'
+		DefaultHilightForegroundColorNoFocus DefaultHilightMode'
 	poolDictionaries:''
 	category:'Views-Lists'
 !
@@ -201,7 +199,9 @@
                         #'selection.hilightFrameColor'      #'selection.hilightLevel'
                         #'selection.foregroundColor'        #'selection.backgroundColor'
                         #'selection.shadowColor'            #'selection.lightColor'
-                        #'selection.font'                   #'selection.hilightStyle'
+                        #'selection.font'                   
+                        #'selection.hilightStyle'
+                        #'selection.highlightMode'
                         #'text.foregroundColor'
                         )>
 
@@ -212,6 +212,7 @@
     DefaultHilightFrameColor       := StyleSheet colorAt:'selection.hilightFrameColor'.
     DefaultHilightLevel            := StyleSheet at:'selection.hilightLevel' default:0.
     DefaultHilightStyle            := StyleSheet at:'selection.hilightStyle' default:(StyleSheet name).
+    DefaultHilightMode             := StyleSheet at:'selection.hilightMode' default:#label. "/ or #line
     DefaultForegroundColor         := StyleSheet colorAt:'selection.foregroundColor'.
     DefaultBackgroundColor         := StyleSheet colorAt:'selection.backgroundColor'.
     DefaultShadowColor             := StyleSheet colorAt:'selection.shadowColor'.
@@ -1126,7 +1127,7 @@
 
     hilightFrameColor notNil ifTrue:[
         hilightLevel == 0 ifTrue:[
-            gc paint:hilightFrameColor.
+            gc paint:(self hasFocus ifTrue:[hilightFrameColor] ifFalse:[hilightBgColorNoFocus]).
 
             highlightMode == #line ifTrue:[
                 gc displayLineFromX:x0 y:y0 toX:x1 y:y0.
@@ -2095,7 +2096,7 @@
 
     hilightFrameColor   := nil.
     hilightStyle        := DefaultHilightStyle.
-    highlightMode       := #label.
+    highlightMode       := DefaultHilightMode ? #label.
     textStartLeft       := 4.
     selectOnMenuButton  := styleSheet at:#'selection.selectOnMenuButton' default:nil.
     selectOnMenuButton isNil ifTrue:[