checkin from browser
authorClaus Gittinger <cg@exept.de>
Sat, 24 Apr 1999 18:30:11 +0200
changeset 1873 6a4a05b093bc
parent 1872 08c4b4a2c65f
child 1874 6ff31b38d752
checkin from browser
Toggle.st
--- a/Toggle.st	Sat Apr 24 18:05:42 1999 +0200
+++ b/Toggle.st	Sat Apr 24 18:30:11 1999 +0200
@@ -365,8 +365,8 @@
     <resource: #style (#'toggle.showLamp'
                        #'toggle.lampColor')>
 
-    DefaultShowLamp := StyleSheet at:'toggle.showLamp' default:false.
-    DefaultLampColor := StyleSheet colorAt:'toggle.lampColor' default:Color yellow.
+    DefaultShowLamp := StyleSheet at:#'toggle.showLamp' default:false.
+    DefaultLampColor := StyleSheet colorAt:#'toggle.lampColor' default:Color yellow.
     LampInset := 1 "2".
 
     "Modified: / 3.11.1997 / 11:42:19 / cg"
@@ -448,7 +448,7 @@
 initStyle
     "setup viewStyle specifics"
 
-    |mm|
+    |mm bg|
 
     super initStyle.
 
@@ -463,11 +463,18 @@
     ].
 
     lampColor := DefaultLampColor.
-    mm := StyleSheet at:'toggle.lampWidthMM' default:1.5.
+    mm := StyleSheet at:#'toggle.lampWidthMM' default:1.5.
     lampWidth := (device horizontalPixelPerMillimeter * mm) rounded.
-    mm := StyleSheet at:'toggle.lampHeightMM' default:3.0.
+    mm := StyleSheet at:#'toggle.lampHeightMM' default:3.0.
     lampHeight := (device verticalPixelPerMillimeter * mm) rounded.
 
+    bg := styleSheet at:#'toggle.backgroundColor'.
+    bg notNil ifTrue:[
+        self backgroundColor:(bg onDevice:device).
+        shadowColor := bg darkened onDevice:device.
+        lightColor := bg lightened onDevice:device.
+    ].
+
     "Modified: / 3.11.1997 / 02:22:02 / cg"
 ! !
 
@@ -610,5 +617,5 @@
 !Toggle class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Toggle.st,v 1.42 1998-06-06 17:54:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Toggle.st,v 1.43 1999-04-24 16:30:11 cg Exp $'
 ! !