handle activeBackgroundColor in viewBackground:
authorca
Wed, 28 Nov 2007 13:49:17 +0100
changeset 3284 2022ac2f9b82
parent 3283 a0388721f027
child 3285 1541e5cf4395
handle activeBackgroundColor in viewBackground:
NoteBookView.st
--- a/NoteBookView.st	Wed Nov 28 13:38:23 2007 +0100
+++ b/NoteBookView.st	Wed Nov 28 13:49:17 2007 +0100
@@ -647,20 +647,20 @@
 !
 
 viewBackground:aColor
-    super viewBackground:aColor.
-
-"/    (edgeStyle isNil and:[viewBackground isColor]) ifTrue:[
-"/        halfShadowColor := shadowColor.
-"/        halfLightColor  := lightColor.
-"/        drawLightColor  := lightColor.
-"/    ].
-"/
-"/    DefaultShadowColor isNil ifTrue:[
-"/        shadowColor := aColor darkened onDevice:device
-"/    ].
-"/    DefaultLightColor isNil ifTrue:[
-"/        lightColor := aColor lightened onDevice:device
-"/    ].
+    aColor isColor ifFalse:[^ self ].
+
+    (aColor isColor and:[viewBackground ~= aColor]) ifTrue:[
+        super viewBackground:aColor.
+        backgroundColor := viewBackground.
+        activeBackgroundColor := backgroundColor.
+
+        backgroundColor brightness < 0.5 ifTrue:[
+            foregroundColor := Color white
+        ] ifFalse:[
+            foregroundColor := Color black.
+        ].
+        activeForegroundColor := foregroundColor.
+    ].
 ! !
 
 !NoteBookView methodsFor:'accessing-dimension'!
@@ -3572,5 +3572,5 @@
 !NoteBookView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.135 2007-11-05 13:25:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.136 2007-11-28 12:49:17 ca Exp $'
 ! !