From 3da9b75d3711e0538834813e7246990dff8e8c3a Mon Sep 17 00:00:00 2001 From: oehhar Date: Wed, 21 Sep 2016 08:31:16 +0000 Subject: Tri-state buttons not working for non-native themes. Bug [3217462] --- library/ttk/clamTheme.tcl | 8 ++++++-- library/ttk/defaults.tcl | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index f184ea0..398a524 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -17,6 +17,8 @@ namespace eval ttk::theme::clam { -lightest "#ffffff" -selectbg "#4a6984" -selectfg "#ffffff" + -altindicator "#9fbdd8" + -disabledaltindicator "#c0c0c0" } ttk::style theme settings clam { @@ -80,9 +82,11 @@ 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 disabled $colors(-frame) pressed $colors(-frame) \ + {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator)] ttk::style map TRadiobutton -indicatorbackground \ - [list disabled $colors(-frame) pressed $colors(-frame)] + [list disabled $colors(-frame) pressed $colors(-frame) \ + {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator)] ttk::style configure TMenubutton \ -width -11 -padding 5 -relief raised diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 05a46bd..2ab6c9c 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -15,6 +15,9 @@ namespace eval ttk::theme::default { -darker "#c3c3c3" -disabledfg "#a3a3a3" -indicator "#4a6984" + -disabledindicator "#a3a3a3" + -altindicator "#9fbdd8" + -disabledaltindicator "#c0c0c0" } ttk::style theme settings default { @@ -45,12 +48,20 @@ 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 selected} $colors(-indicator) {disabled selected} $colors(-disabledindicator) \ + {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator)] + 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 selected} $colors(-indicator) {disabled selected} $colors(-disabledindicator) \ + {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator)] + ttk::style map TRadiobutton -indicatorrelief \ + [list alternate raised] ttk::style configure TMenubutton \ -relief raised -padding "10 3" -- cgit v0.12 From 86e95cea7354485132002aeb8674a218a3cb675f Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 24 Sep 2016 16:57:23 +0000 Subject: Improved formatting --- library/ttk/clamTheme.tcl | 24 ++++++++++++------------ library/ttk/defaults.tcl | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index 398a524..eddacdd 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -7,18 +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" - -altindicator "#9fbdd8" - -disabledaltindicator "#c0c0c0" + -disabledfg "#999999" + -frame "#dcdad5" + -window "#ffffff" + -dark "#cfcdc8" + -darker "#bab5ab" + -darkest "#9e9a91" + -lighter "#eeebe7" + -lightest "#ffffff" + -selectbg "#4a6984" + -selectfg "#ffffff" + -altindicator "#9fbdd8" + -disabledaltindicator "#c0c0c0" } ttk::style theme settings clam { diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 2ab6c9c..548d5fe 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -5,19 +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" + -altindicator "#9fbdd8" + -disabledaltindicator "#c0c0c0" } ttk::style theme settings default { -- cgit v0.12 From daea4e2ae99a82f91e3b19d8798b07263623b74f Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 24 Sep 2016 18:27:11 +0000 Subject: Fixed clam theme for all states --- library/ttk/clamTheme.tcl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index eddacdd..f465922 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -82,11 +82,13 @@ namespace eval ttk::theme::clam { -indicatormargin {1 1 4 1} \ -padding 2 ; ttk::style map TCheckbutton -indicatorbackground \ - [list disabled $colors(-frame) pressed $colors(-frame) \ - {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator)] + [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) \ - {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator)] + [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 -- cgit v0.12 From 3e694f4b61010dbd0214355d77014613d5aa0611 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 24 Sep 2016 18:28:40 +0000 Subject: Long lines are ugly --- library/ttk/clamTheme.tcl | 6 ++++-- library/ttk/defaults.tcl | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index f465922..e6cabb7 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -83,11 +83,13 @@ namespace eval ttk::theme::clam { -padding 2 ; ttk::style map TCheckbutton -indicatorbackground \ [list pressed $colors(-frame) \ - {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator) \ + {!disabled alternate} $colors(-altindicator) \ + {disabled alternate} $colors(-disabledaltindicator) \ disabled $colors(-frame)] ttk::style map TRadiobutton -indicatorbackground \ [list pressed $colors(-frame) \ - {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator) \ + {!disabled alternate} $colors(-altindicator) \ + {disabled alternate} $colors(-disabledaltindicator) \ disabled $colors(-frame)] ttk::style configure TMenubutton \ diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 548d5fe..f07cbf7 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -49,8 +49,10 @@ namespace eval ttk::theme::default { -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1 ttk::style map TCheckbutton -indicatorcolor \ [list pressed $colors(-activebg) \ - {!disabled selected} $colors(-indicator) {disabled selected} $colors(-disabledindicator) \ - {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator)] + {!disabled selected} $colors(-indicator) \ + {disabled selected} $colors(-disabledindicator) \ + {!disabled alternate} $colors(-altindicator) \ + {disabled alternate} $colors(-disabledaltindicator)] ttk::style map TCheckbutton -indicatorrelief \ [list alternate raised] @@ -58,8 +60,10 @@ namespace eval ttk::theme::default { -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1 ttk::style map TRadiobutton -indicatorcolor \ [list pressed $colors(-activebg) \ - {!disabled selected} $colors(-indicator) {disabled selected} $colors(-disabledindicator) \ - {!disabled alternate} $colors(-altindicator) {disabled alternate} $colors(-disabledaltindicator)] + {!disabled selected} $colors(-indicator) \ + {disabled selected} $colors(-disabledindicator) \ + {!disabled alternate} $colors(-altindicator) \ + {disabled alternate} $colors(-disabledaltindicator)] ttk::style map TRadiobutton -indicatorrelief \ [list alternate raised] -- cgit v0.12 From eb9183790f07065eb2210b29d6fc9276e49481e1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 24 Sep 2016 21:50:11 +0000 Subject: Fixed typo --- doc/ttk_vsapi.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v0.12 From e05a73a1dc281d212fc7f4f6b35e0bc5f4204d9c Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 25 Sep 2016 19:20:24 +0000 Subject: Fixed [3217462fff] for the alt and classic themes --- library/ttk/altTheme.tcl | 9 +++++++-- library/ttk/classicTheme.tcl | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) 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/classicTheme.tcl b/library/ttk/classicTheme.tcl index 7e3eff5..e510361 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,14 +50,18 @@ namespace eval ttk::theme::classic { ttk::style configure TCheckbutton -indicatorrelief raised ttk::style map TCheckbutton \ -indicatorcolor [list \ - pressed $colors(-frame) selected $colors(-indicator)] \ + pressed $colors(-frame) \ + selected $colors(-indicator) \ + alternate $colors(-altindicator)] \ -indicatorrelief {selected sunken pressed sunken} \ ; ttk::style configure TRadiobutton -indicatorrelief raised ttk::style map TRadiobutton \ -indicatorcolor [list \ - pressed $colors(-frame) selected $colors(-indicator)] \ + pressed $colors(-frame) \ + selected $colors(-indicator) \ + alternate $colors(-altindicator)] \ -indicatorrelief {selected sunken pressed sunken} \ ; -- cgit v0.12 From 828f2c0dd8dccab4a455c82bcf4550036926032c Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 5 Oct 2016 13:48:53 +0000 Subject: Changed themes 'classic' and 'default' according to comments from Christian Gollwitzer in [3217462fff] --- library/ttk/classicTheme.tcl | 12 ++++++------ library/ttk/defaults.tcl | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index e510361..3cb2b18 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -51,18 +51,18 @@ namespace eval ttk::theme::classic { ttk::style map TCheckbutton \ -indicatorcolor [list \ pressed $colors(-frame) \ - selected $colors(-indicator) \ - alternate $colors(-altindicator)] \ - -indicatorrelief {selected sunken pressed sunken} \ + 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) \ - alternate $colors(-altindicator)] \ - -indicatorrelief {selected sunken pressed sunken} \ + 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 f07cbf7..853ed20 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -49,10 +49,10 @@ namespace eval ttk::theme::default { -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1 ttk::style map TCheckbutton -indicatorcolor \ [list pressed $colors(-activebg) \ - {!disabled selected} $colors(-indicator) \ - {disabled selected} $colors(-disabledindicator) \ {!disabled alternate} $colors(-altindicator) \ - {disabled alternate} $colors(-disabledaltindicator)] + {disabled alternate} $colors(-disabledaltindicator) \ + {!disabled selected} $colors(-indicator) \ + {disabled selected} $colors(-disabledindicator)] ttk::style map TCheckbutton -indicatorrelief \ [list alternate raised] @@ -60,10 +60,10 @@ namespace eval ttk::theme::default { -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1 ttk::style map TRadiobutton -indicatorcolor \ [list pressed $colors(-activebg) \ - {!disabled selected} $colors(-indicator) \ - {disabled selected} $colors(-disabledindicator) \ {!disabled alternate} $colors(-altindicator) \ - {disabled alternate} $colors(-disabledaltindicator)] + {disabled alternate} $colors(-disabledaltindicator) \ + {!disabled selected} $colors(-indicator) \ + {disabled selected} $colors(-disabledindicator)] ttk::style map TRadiobutton -indicatorrelief \ [list alternate raised] -- cgit v0.12 From 5f5b571ffeda160176a575beb298a510a46b4751 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 5 Oct 2016 14:45:53 +0000 Subject: 'clam' theme: darker blue for the inside of the box in alternate state --- library/ttk/clamTheme.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index e6cabb7..f4ad43b 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -17,8 +17,8 @@ namespace eval ttk::theme::clam { -lightest "#ffffff" -selectbg "#4a6984" -selectfg "#ffffff" - -altindicator "#9fbdd8" - -disabledaltindicator "#c0c0c0" + -altindicator "#5895bc" + -disabledaltindicator "#a0a0a0" } ttk::style theme settings clam { -- cgit v0.12 From 549f2d1d605a90214702cc88d5516ac24e6996b2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 5 Oct 2016 15:46:23 +0000 Subject: 'xpnative' and 'vista' (and 'aqua') themes: 'alternate on' changed to be identical to 'alternate', for radiobuttons --- win/ttkWinXPTheme.c | 2 ++ 1 file changed, 2 insertions(+) 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}, -- cgit v0.12