diff options
author | fvogel <fvogelnew1@free.fr> | 2016-10-12 19:30:09 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-10-12 19:30:09 (GMT) |
commit | 3777c7414cf7ce927a2e71969018eab91f98815b (patch) | |
tree | 28cb5dda4a97398f7ef1d023955eefc1adcf3118 | |
parent | 8bb0c09912bcf8aaa8d5366525d7895c0fe96ad7 (diff) | |
parent | 549f2d1d605a90214702cc88d5516ac24e6996b2 (diff) | |
download | tk-3777c7414cf7ce927a2e71969018eab91f98815b.zip tk-3777c7414cf7ce927a2e71969018eab91f98815b.tar.gz tk-3777c7414cf7ce927a2e71969018eab91f98815b.tar.bz2 |
Fixed [3217462fff] - Tri-state buttons not working for non-native themes
-rw-r--r-- | doc/ttk_vsapi.n | 2 | ||||
-rw-r--r-- | library/ttk/altTheme.tcl | 9 | ||||
-rw-r--r-- | library/ttk/clamTheme.tcl | 32 | ||||
-rw-r--r-- | library/ttk/classicTheme.tcl | 13 | ||||
-rw-r--r-- | library/ttk/defaults.tcl | 39 | ||||
-rw-r--r-- | win/ttkWinXPTheme.c | 2 |
6 files changed, 66 insertions, 31 deletions
diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n index 334836c..4d5c3eb 100644 --- a/doc/ttk_vsapi.n +++ b/doc/ttk_vsapi.n @@ -61,7 +61,7 @@ corresponding Visual Styles API state value. This permits the element appearance to respond to changes in the widget state such as becoming active or being pressed. The list should be as described for the \fBttk::style map\fR command but note that the -last pair in the list should be the default state and is typically and +last pair in the list should be the default state and is typically an empty list and 1. Unfortunately all the Visual Styles parts have different state values and these must be looked up either in the Microsoft documentation or more likely in the header files. The diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl index d57227c..e792539 100644 --- a/library/ttk/altTheme.tcl +++ b/library/ttk/altTheme.tcl @@ -14,6 +14,7 @@ namespace eval ttk::theme::alt { -disabledfg "#a3a3a3" -selectbg "#4a6984" -selectfg "#ffffff" + -altindicator "#aaaaaa" } ttk::style theme settings alt { @@ -46,9 +47,13 @@ namespace eval ttk::theme::alt { ttk::style configure TCheckbutton -indicatorcolor "#ffffff" -padding 2 ttk::style configure TRadiobutton -indicatorcolor "#ffffff" -padding 2 ttk::style map TCheckbutton -indicatorcolor \ - [list disabled $colors(-frame) pressed $colors(-frame)] + [list pressed $colors(-frame) \ + alternate $colors(-altindicator) \ + disabled $colors(-frame)] ttk::style map TRadiobutton -indicatorcolor \ - [list disabled $colors(-frame) pressed $colors(-frame)] + [list pressed $colors(-frame) \ + alternate $colors(-altindicator) \ + disabled $colors(-frame)] ttk::style configure TMenubutton \ -width -11 -padding "3 3" -relief raised diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index f184ea0..f4ad43b 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -7,16 +7,18 @@ namespace eval ttk::theme::clam { variable colors array set colors { - -disabledfg "#999999" - -frame "#dcdad5" - -window "#ffffff" - -dark "#cfcdc8" - -darker "#bab5ab" - -darkest "#9e9a91" - -lighter "#eeebe7" - -lightest "#ffffff" - -selectbg "#4a6984" - -selectfg "#ffffff" + -disabledfg "#999999" + -frame "#dcdad5" + -window "#ffffff" + -dark "#cfcdc8" + -darker "#bab5ab" + -darkest "#9e9a91" + -lighter "#eeebe7" + -lightest "#ffffff" + -selectbg "#4a6984" + -selectfg "#ffffff" + -altindicator "#5895bc" + -disabledaltindicator "#a0a0a0" } ttk::style theme settings clam { @@ -80,9 +82,15 @@ namespace eval ttk::theme::clam { -indicatormargin {1 1 4 1} \ -padding 2 ; ttk::style map TCheckbutton -indicatorbackground \ - [list disabled $colors(-frame) pressed $colors(-frame)] + [list pressed $colors(-frame) \ + {!disabled alternate} $colors(-altindicator) \ + {disabled alternate} $colors(-disabledaltindicator) \ + disabled $colors(-frame)] ttk::style map TRadiobutton -indicatorbackground \ - [list disabled $colors(-frame) pressed $colors(-frame)] + [list pressed $colors(-frame) \ + {!disabled alternate} $colors(-altindicator) \ + {disabled alternate} $colors(-disabledaltindicator) \ + disabled $colors(-frame)] ttk::style configure TMenubutton \ -width -11 -padding 5 -relief raised diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 7e3eff5..3cb2b18 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -15,6 +15,7 @@ namespace eval ttk::theme::classic { -selectfg "#000000" -disabledfg "#a3a3a3" -indicator "#b03060" + -altindicator "#b05e5e" } ttk::style theme settings classic { @@ -49,15 +50,19 @@ namespace eval ttk::theme::classic { ttk::style configure TCheckbutton -indicatorrelief raised ttk::style map TCheckbutton \ -indicatorcolor [list \ - pressed $colors(-frame) selected $colors(-indicator)] \ - -indicatorrelief {selected sunken pressed sunken} \ + pressed $colors(-frame) \ + alternate $colors(-altindicator) \ + selected $colors(-indicator)] \ + -indicatorrelief {alternate raised selected sunken pressed sunken} \ ; ttk::style configure TRadiobutton -indicatorrelief raised ttk::style map TRadiobutton \ -indicatorcolor [list \ - pressed $colors(-frame) selected $colors(-indicator)] \ - -indicatorrelief {selected sunken pressed sunken} \ + pressed $colors(-frame) \ + alternate $colors(-altindicator) \ + selected $colors(-indicator)] \ + -indicatorrelief {alternate raised selected sunken pressed sunken} \ ; ttk::style configure TMenubutton -relief raised -padding "3m 1m" diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 05a46bd..853ed20 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -5,16 +5,19 @@ namespace eval ttk::theme::default { variable colors array set colors { - -frame "#d9d9d9" - -foreground "#000000" - -window "#ffffff" - -text "#000000" - -activebg "#ececec" - -selectbg "#4a6984" - -selectfg "#ffffff" - -darker "#c3c3c3" - -disabledfg "#a3a3a3" - -indicator "#4a6984" + -frame "#d9d9d9" + -foreground "#000000" + -window "#ffffff" + -text "#000000" + -activebg "#ececec" + -selectbg "#4a6984" + -selectfg "#ffffff" + -darker "#c3c3c3" + -disabledfg "#a3a3a3" + -indicator "#4a6984" + -disabledindicator "#a3a3a3" + -altindicator "#9fbdd8" + -disabledaltindicator "#c0c0c0" } ttk::style theme settings default { @@ -45,12 +48,24 @@ namespace eval ttk::theme::default { ttk::style configure TCheckbutton \ -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1 ttk::style map TCheckbutton -indicatorcolor \ - [list pressed $colors(-activebg) selected $colors(-indicator)] + [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 "#ffffff" -indicatorrelief sunken -padding 1 ttk::style map TRadiobutton -indicatorcolor \ - [list pressed $colors(-activebg) selected $colors(-indicator)] + [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] ttk::style configure TMenubutton \ -relief raised -padding "10 3" diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 08569a3..3de1504 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -208,6 +208,8 @@ static Ttk_StateTable checkbox_statemap[] = */ static Ttk_StateTable radiobutton_statemap[] = { +{RBS_UNCHECKEDDISABLED, TTK_STATE_ALTERNATE|TTK_STATE_DISABLED, 0}, +{RBS_UNCHECKEDNORMAL, TTK_STATE_ALTERNATE, 0}, {RBS_CHECKEDDISABLED, TTK_STATE_SELECTED|TTK_STATE_DISABLED, 0}, {RBS_CHECKEDPRESSED, TTK_STATE_SELECTED|TTK_STATE_PRESSED, 0}, {RBS_CHECKEDHOT, TTK_STATE_SELECTED|TTK_STATE_ACTIVE, 0}, |