Separating DefaultForegroundColor and DefaultBackgroundColor from pullDownMenu colors
--- a/MenuPanel.st Thu Jun 09 09:12:11 2022 +0200
+++ b/MenuPanel.st Fri Jun 17 14:34:29 2022 +0200
@@ -2,6 +2,7 @@
COPYRIGHT (c) 1997 by eXept Software AG
COPYRIGHT (c) 2016-2018 Jan Vrany
COPYRIGHT (c) 2021-2022 LabWare
+ COPYRIGHT (c) 2022 Patrik Svestka
All Rights Reserved
This software is furnished under a license and may be used
@@ -73,6 +74,7 @@
COPYRIGHT (c) 1997 by eXept Software AG
COPYRIGHT (c) 2016-2018 Jan Vrany
COPYRIGHT (c) 2021-2022 LabWare
+ COPYRIGHT (c) 2022 Patrik Svestka
All Rights Reserved
This software is furnished under a license and may be used
@@ -774,14 +776,19 @@
style := styleSheet name.
DefaultFont := MenuView defaultFont.
- foregroundColor := DefaultForegroundColor := styleSheet colorAt:#'pullDownMenu.foregroundColor'
- default:[styleSheet
- colorAt:#'menu.foregroundColor'
- default:Color black].
- backgroundColor := DefaultBackgroundColor := styleSheet colorAt:#'pullDownMenu.backgroundColor'
- default:[styleSheet
- colorAt:#'menu.backgroundColor'
- default:DefaultViewBackgroundColor].
+ DefaultForegroundColor := styleSheet colorAt:#'menu.foregroundColor' default:Color black.
+ DefaultBackgroundColor := styleSheet colorAt:#'menu.backgroundColor' default:DefaultViewBackgroundColor.
+
+ foregroundColor := styleSheet colorAt:#'pullDownMenu.foregroundColor'
+ default:[styleSheet colorAt:#'menu.foregroundColor'
+ default:Color black].
+ backgroundColor := styleSheet colorAt:#'pullDownMenu.backgroundColor'
+ default:[styleSheet colorAt:#'menu.backgroundColor'
+ default:DefaultViewBackgroundColor].
+
+ var := styleSheet colorAt:#'menu.hilightForegroundColor'.
+ var isNil ifTrue:[ var := styleSheet is3D ifTrue:[foregroundColor] ifFalse:[backgroundColor] ].
+ styleSheet at:#'menuPanel.activeForegroundColor' put:var.
var := styleSheet colorAt:#'menu.hilightBackgroundColor'.
var isNil ifTrue:[
@@ -790,10 +797,6 @@
].
styleSheet at:#'menuPanel.activeBackgroundColor' put:var.
- var := styleSheet colorAt:#'menu.disabledEtchedForegroundColor'.
- var isNil ifTrue:[ var := styleSheet colorAt:#'button.disabledEtchedForegroundColor' ].
- styleSheet at:#'menuPanel.disabledEtchedFgColor' put:var.
-
var := styleSheet colorAt:#'menu.disabledForegroundColor'.
var isNil ifTrue:[
var := styleSheet colorAt:#'selection.disabledForegroundColor'.
@@ -801,10 +804,9 @@
].
styleSheet at:#'menuPanel.disabledForegroundColor' put:var.
- var := styleSheet colorAt:#'menu.hilightForegroundColor'.
- var isNil ifTrue:[ var := styleSheet is3D ifTrue:[foregroundColor] ifFalse:[backgroundColor] ].
- styleSheet at:#'menuPanel.activeForegroundColor' put:var.
-
+ var := styleSheet colorAt:#'menu.disabledEtchedForegroundColor'.
+ var isNil ifTrue:[ var := styleSheet colorAt:#'button.disabledEtchedForegroundColor' ].
+ styleSheet at:#'menuPanel.disabledEtchedFgColor' put:var.
buttonActiveLevel := styleSheet at:#'menu.buttonActiveLevel' default:(styleSheet is3D ifTrue:[-2] ifFalse:[0]).
buttonActiveLevel isNil ifTrue:[ buttonActiveLevel := styleSheet at:#'button.activeLevel' default:(styleSheet is3D ifTrue:[-2] ifFalse:[0]) ].
@@ -868,6 +870,7 @@
"
"Modified: / 19-01-2012 / 13:17:59 / cg"
+ "Modified (format): / 24-06-2022 / 11:57:59 / Patrik Svestka <patrik.svestka@gmail.com>"
! !
!MenuPanel class methodsFor:'image registration'!