diff options
author | fvogel <fvogelnew1@free.fr> | 2020-07-14 21:52:42 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2020-07-14 21:52:42 (GMT) |
commit | 9880f62f83f872bbe81ba1e687a12143094dc412 (patch) | |
tree | fe0eb36a84ccb6bfa7584b39ca5273bdcd2e42e5 | |
parent | 21e0598412d86c57af86d200b727a942a31a7dcf (diff) | |
download | tk-9880f62f83f872bbe81ba1e687a12143094dc412.zip tk-9880f62f83f872bbe81ba1e687a12143094dc412.tar.gz tk-9880f62f83f872bbe81ba1e687a12143094dc412.tar.bz2 |
Revert from 'SystemPlaceHolderTextColor' to 'SystemPlaceHolderText' on Windows, and deal with all ttk widgets having -placeholderforeground option to let them use the adequate platform default color for platform-specific themes.
-rw-r--r-- | doc/colors.n | 2 | ||||
-rw-r--r-- | library/ttk/aquaTheme.tcl | 9 | ||||
-rw-r--r-- | library/ttk/vistaTheme.tcl | 9 | ||||
-rw-r--r-- | library/ttk/winTheme.tcl | 9 | ||||
-rw-r--r-- | library/ttk/xpTheme.tcl | 9 | ||||
-rw-r--r-- | win/tkWinColor.c | 2 | ||||
-rw-r--r-- | win/tkWinDefault.h | 2 |
7 files changed, 27 insertions, 15 deletions
diff --git a/doc/colors.n b/doc/colors.n index 6e3e64e..3c20e8a 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -978,7 +978,7 @@ systemAppWorkspace systemInfoBackground systemBackground systemInfoText systemButtonFace systemMenu systemButtonHighlight systemMenuText -systemButtonShadow systemPlaceholderTextColor +systemButtonShadow systemPlaceholderText systemButtonText systemScrollbar systemCaptionText systemWindow systemDisabledText systemWindowFrame diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl index 8bba226..f5b1026 100644 --- a/library/ttk/aquaTheme.tcl +++ b/library/ttk/aquaTheme.tcl @@ -38,7 +38,8 @@ namespace eval ttk::theme::aqua { # Entry ttk::style configure TEntry \ -foreground systemTextColor \ - -background systemTextBackgroundColor + -background systemTextBackgroundColor \ + -placeholderforeground systemPlaceholderTextColor ttk::style map TEntry \ -foreground { disabled systemDisabledControlTextColor @@ -70,7 +71,8 @@ namespace eval ttk::theme::aqua { # Combobox: ttk::style configure TCombobox \ -foreground systemTextColor \ - -background systemTransparent + -background systemTransparent \ + -placeholderforeground systemPlaceholderTextColor ttk::style map TCombobox \ -foreground { disabled systemDisabledControlTextColor @@ -87,7 +89,8 @@ namespace eval ttk::theme::aqua { -foreground systemTextColor \ -background systemTextBackgroundColor \ -selectforeground systemSelectedTextColor \ - -selectbackground systemSelectedTextBackgroundColor + -selectbackground systemSelectedTextBackgroundColor \ + -placeholderforeground systemPlaceholderTextColor ttk::style map TSpinbox \ -foreground { disabled systemDisabledControlTextColor diff --git a/library/ttk/vistaTheme.tcl b/library/ttk/vistaTheme.tcl index 165b496..d37cc27 100644 --- a/library/ttk/vistaTheme.tcl +++ b/library/ttk/vistaTheme.tcl @@ -58,7 +58,8 @@ namespace eval ttk::theme::vista { ttk::style configure Toolbutton -padding {4 4} # Combobox - ttk::style configure TCombobox -padding 2 + ttk::style configure TCombobox -padding 2 \ + -placeholderforeground SystemPlaceholderText ttk::style element create Combobox.border vsapi \ COMBOBOX 4 {disabled 4 focus 3 active 2 hover 2 {} 1} ttk::style element create Combobox.background vsapi \ @@ -97,7 +98,8 @@ namespace eval ttk::theme::vista { ; # Entry - ttk::style configure TEntry -padding {1 1 1 1} ;# Needs lookup + ttk::style configure TEntry -padding {1 1 1 1} \ + -placeholderforeground SystemPlaceholderText ttk::style element create Entry.field vsapi \ EDIT 6 {disabled 4 focus 3 hover 2 {} 1} -padding {2 2 2 2} ttk::style element create Entry.background vsapi \ @@ -117,7 +119,8 @@ namespace eval ttk::theme::vista { ; # Spinbox - ttk::style configure TSpinbox -padding 0 + ttk::style configure TSpinbox -padding 0 \ + -placeholderforeground SystemPlaceholderText ttk::style element create Spinbox.field vsapi \ EDIT 9 {disabled 4 focus 3 hover 2 {} 1} -padding {1 1 1 2} ttk::style element create Spinbox.background vsapi \ diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl index db05b45..bc81ced 100644 --- a/library/ttk/winTheme.tcl +++ b/library/ttk/winTheme.tcl @@ -29,7 +29,8 @@ namespace eval ttk::theme::winnative { ttk::style map TButton -relief {{!disabled pressed} sunken} ttk::style configure TEntry \ - -padding 2 -selectborderwidth 0 -insertwidth 1 + -padding 2 -selectborderwidth 0 -insertwidth 1 \ + -placeholderforeground SystemPlaceholderText ttk::style map TEntry \ -fieldbackground \ [list readonly SystemButtonFace disabled SystemButtonFace] \ @@ -37,7 +38,8 @@ namespace eval ttk::theme::winnative { -selectforeground [list !focus SystemWindowText] \ ; - ttk::style configure TCombobox -padding 2 + ttk::style configure TCombobox -padding 2 \ + -placeholderforeground SystemPlaceholderText ttk::style map TCombobox \ -selectbackground [list !focus SystemWindow] \ -selectforeground [list !focus SystemWindowText] \ @@ -55,7 +57,8 @@ namespace eval ttk::theme::winnative { ttk::style configure ComboboxPopdownFrame \ -borderwidth 1 -relief solid - ttk::style configure TSpinbox -padding {2 0 16 0} + ttk::style configure TSpinbox -padding {2 0 16 0} \ + -placeholderforeground SystemPlaceholderText ttk::style configure TLabelframe -borderwidth 2 -relief groove diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl index da7b422..9cfa1ef 100644 --- a/library/ttk/xpTheme.tcl +++ b/library/ttk/xpTheme.tcl @@ -31,12 +31,14 @@ namespace eval ttk::theme::xpnative { ttk::style configure TLabelframe.Label -foreground "#0046d5" # OR: -padding {3 3 3 6}, which some apps seem to use. - ttk::style configure TEntry -padding {2 2 2 4} + ttk::style configure TEntry -padding {2 2 2 4} \ + -placeholderforeground SystemPlaceholderText ttk::style map TEntry \ -selectbackground [list !focus SystemWindow] \ -selectforeground [list !focus SystemWindowText] \ ; - ttk::style configure TCombobox -padding 2 + ttk::style configure TCombobox -padding 2 \ + -placeholderforeground SystemPlaceholderText ttk::style map TCombobox \ -selectbackground [list !focus SystemWindow] \ -selectforeground [list !focus SystemWindowText] \ @@ -47,7 +49,8 @@ namespace eval ttk::theme::xpnative { -focusfill [list {readonly focus} SystemHighlight] \ ; - ttk::style configure TSpinbox -padding {2 0 14 0} + ttk::style configure TSpinbox -padding {2 0 14 0} \ + -placeholderforeground SystemPlaceholderText ttk::style map TSpinbox \ -selectbackground [list !focus SystemWindow] \ -selectforeground [list !focus SystemWindowText] \ diff --git a/win/tkWinColor.c b/win/tkWinColor.c index bb7d859..ab43304 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -58,7 +58,7 @@ static const SystemColorEntry sysColors[] = { {"InfoText", COLOR_INFOTEXT}, {"Menu", COLOR_MENU}, {"MenuText", COLOR_MENUTEXT}, - {"PlaceHolderTextColor", COLOR_GRAYTEXT}, + {"PlaceHolderText", COLOR_GRAYTEXT}, {"Scrollbar", COLOR_SCROLLBAR}, {"Window", COLOR_WINDOW}, {"WindowFrame", COLOR_WINDOWFRAME}, diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index a690a5c..eaceb42 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -158,7 +158,7 @@ #define DEF_ENTRY_INSERT_WIDTH "2" #define DEF_ENTRY_JUSTIFY "left" #define DEF_ENTRY_PLACEHOLDER "" -#define DEF_ENTRY_PLACEHOLDERFG "SystemPlaceHolderTextColor" +#define DEF_ENTRY_PLACEHOLDERFG "SystemPlaceHolderText" #define DEF_ENTRY_READONLY_BG_COLOR "SystemButtonFace" #define DEF_ENTRY_READONLY_BG_MONO WHITE #define DEF_ENTRY_RELIEF "sunken" |