summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorcsaba <csaba>2023-05-11 14:51:16 (GMT)
committercsaba <csaba>2023-05-11 14:51:16 (GMT)
commit9fd59f36dfce24d68e74ac61ac314929bd95de96 (patch)
tree162b6d6f5f88cab275231512c195cd7d000f093d /library
parentb3ed39dfb05fa1ac8a1403dbd25bdd893dc87e13 (diff)
parentb738574434d8eafdc4fb1354369a499e82ad6751 (diff)
downloadtk-9fd59f36dfce24d68e74ac61ac314929bd95de96.zip
tk-9fd59f36dfce24d68e74ac61ac314929bd95de96.tar.gz
tk-9fd59f36dfce24d68e74ac61ac314929bd95de96.tar.bz2
Merged branch new-default-indicators into trunk
Diffstat (limited to 'library')
-rw-r--r--library/ttk/defaults.tcl52
1 files changed, 19 insertions, 33 deletions
diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl
index ba851cb..6f46dfd 100644
--- a/library/ttk/defaults.tcl
+++ b/library/ttk/defaults.tcl
@@ -18,8 +18,7 @@ namespace eval ttk::theme::default {
-disabledfg "#a3a3a3"
-indicator "#4a6984"
-disabledindicator "#a3a3a3"
- -altindicator "#9fbdd8"
- -disabledaltindicator "#c0c0c0"
+ -pressedindicator "#5895bc"
}
# On X11, if the user specifies their own choice of colour scheme via
@@ -40,14 +39,12 @@ namespace eval ttk::theme::default {
{ selectBackground SelectBackground }
{ disabledForeground DisabledForeground }
{ selectBackground SelectBackground }
- { troughColor TroughColor }
{ windowColor Background } } \
colorName {
-frame -foreground -window -alternate -text
-activebg -selectbg -selectfg
-darker -disabledfg -indicator
- -disabledindicator -altindicator
- -disabledaltindicator -window } {
+ -disabledindicator -pressedindicator -window } {
set color [eval option get . $xResourceName]
if {$color ne ""} {
set colors($colorName) $color
@@ -64,9 +61,9 @@ namespace eval ttk::theme::default {
background {-frame -window -alternate}
foreground {-foreground -text}
activeBackground -activebg
- selectBackground {-selectbg -indicator -altindicator}
+ selectBackground {-selectbg -indicator -pressedindicator}
selectForeground -selectfg
- troughColor {-darker -disabledaltindicator}
+ troughColor -darker
disabledForeground {-disabledfg -disabledindicator}
}
}
@@ -97,7 +94,6 @@ proc ttk::theme::default::reconfigureDefaultTheme {} {
-selectbackground $colors(-selectbg) \
-selectforeground $colors(-selectfg) \
-insertwidth 1 \
- -indicatordiameter 10 \
;
ttk::style map "." -background \
@@ -114,31 +110,21 @@ proc ttk::theme::default::reconfigureDefaultTheme {} {
-relief raised -shiftrelief 1
ttk::style map TButton -relief [list {!disabled pressed} sunken]
- ttk::style configure TCheckbutton \
- -indicatorcolor $colors(-window) -indicatorrelief sunken \
- -indicatordiameter 7.5p -indicatormargin {0 1.5p 3p 1.5p} \
- -padding 0.75p
- ttk::style map TCheckbutton -indicatorcolor \
- [list pressed $colors(-activebg) \
- {!disabled alternate} $colors(-altindicator) \
- {disabled alternate} $colors(-disabledaltindicator) \
- {!disabled selected} $colors(-indicator) \
- {disabled selected} $colors(-disabledindicator)]
- ttk::style map TCheckbutton -indicatorrelief \
- [list alternate raised]
-
- ttk::style configure TRadiobutton \
- -indicatorcolor $colors(-window) -indicatorrelief sunken \
- -indicatordiameter 7.5p -indicatormargin {0 1.5p 3p 1.5p} \
- -padding 0.75p
- ttk::style map TRadiobutton -indicatorcolor \
- [list pressed $colors(-activebg) \
- {!disabled alternate} $colors(-altindicator) \
- {disabled alternate} $colors(-disabledaltindicator) \
- {!disabled selected} $colors(-indicator) \
- {disabled selected} $colors(-disabledindicator)]
- ttk::style map TRadiobutton -indicatorrelief \
- [list alternate raised]
+ foreach style {TCheckbutton TRadiobutton} {
+ ttk::style configure $style \
+ -indicatorbackground $colors(-window) \
+ -indicatorforeground $colors(-selectfg) \
+ -indicatormargin {0 1.5p 3p 1.5p} -padding 0.75p
+ ttk::style map $style -indicatorbackground \
+ [list {alternate disabled} $colors(-disabledindicator) \
+ {alternate pressed} $colors(-pressedindicator) \
+ alternate $colors(-indicator) \
+ {selected disabled} $colors(-disabledindicator) \
+ {selected pressed} $colors(-pressedindicator) \
+ selected $colors(-indicator) \
+ disabled $colors(-frame) \
+ pressed $colors(-darker)]
+ }
ttk::style configure TMenubutton \
-relief raised -indicatormargin {3.75p 0} -padding {7.5p 2.25p}