diff options
author | dgp <dgp@users.sourceforge.net> | 2020-12-07 17:08:05 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-12-07 17:08:05 (GMT) |
commit | e95e6197207d4aae81e8046f1ef5c63bc420f1ff (patch) | |
tree | 677897e80a6e80c5349d2227c475c7b43a5fb02e /library | |
parent | 6bf3b7356d8f53c983b5a5a196752afd7031000d (diff) | |
parent | f5312f21552eeb863f2d46fec33b0e4d4fc2173d (diff) | |
download | tk-e95e6197207d4aae81e8046f1ef5c63bc420f1ff.zip tk-e95e6197207d4aae81e8046f1ef5c63bc420f1ff.tar.gz tk-e95e6197207d4aae81e8046f1ef5c63bc420f1ff.tar.bz2 |
merge 8.6
Diffstat (limited to 'library')
-rw-r--r-- | library/demos/menu.tcl | 21 | ||||
-rw-r--r-- | library/ttk/aquaTheme.tcl | 63 |
2 files changed, 41 insertions, 43 deletions
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl index 6989523..62991f3 100644 --- a/library/demos/menu.tcl +++ b/library/demos/menu.tcl @@ -144,9 +144,24 @@ $m entryconfigure "Does almost nothing" -bitmap questhead -compound left \ set m $w.menu.colors $w.menu add cascade -label "Colors" -menu $m -underline 1 menu $m -tearoff 1 -foreach i {red orange yellow green blue} { - $m add command -label $i -background $i -command [list \ - puts "You invoked \"$i\"" ] +if {[tk windowingsystem] eq "aqua"} { + # Aqua ignores the -background and -foreground options, but a compound + # button can be used for selecting colors. + foreach i {red orange yellow green blue} { + image create photo image_$i -height 16 -width 16 + image_$i put black -to 0 0 16 1 + image_$i put black -to 0 1 1 16 + image_$i put black -to 0 15 16 16 + image_$i put black -to 15 1 16 16 + image_$i put $i -to 1 1 15 15 + $m add command -label $i -image image_$i -compound left -command [list \ + puts "You invoked \"$i\"" ] + } +} else { + foreach i {red orange yellow green blue} { + $m add command -label $i -background $i -command [list \ + puts "You invoked \"$i\"" ] + } } $w configure -menu $w.menu diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl index 8bba226..51c3e49 100644 --- a/library/ttk/aquaTheme.tcl +++ b/library/ttk/aquaTheme.tcl @@ -35,21 +35,38 @@ namespace eval ttk::theme::aqua { ttk::style configure TMenubutton -anchor center -padding {2 0 0 2} ttk::style configure Toolbutton -anchor center + # For Entry, Combobox and Spinbox widgets the selected text background + # is the "Highlight color" selected in preferences when the widget + # has focus. It is a gray color when the widget does not have focus or + # the window does not have focus. (The background state implies !focus + # so we only need to specify !focus.) + # Entry - ttk::style configure TEntry \ - -foreground systemTextColor \ - -background systemTextBackgroundColor ttk::style map TEntry \ -foreground { disabled systemDisabledControlTextColor } \ - -selectforeground { - background systemTextColor + -selectbackground { + !focus systemUnemphasizedSelectedTextBackgroundColor + } + + # Combobox: + ttk::style map TCombobox \ + -foreground { + disabled systemDisabledControlTextColor } \ -selectbackground { - background systemTextBackgroundColor + !focus systemUnemphasizedSelectedTextBackgroundColor } + # Spinbox + ttk::style map TSpinbox \ + -foreground { + disabled systemDisabledControlTextColor + } \ + -selectbackground { + !focus systemUnemphasizedSelectedTextBackgroundColor + } # Workaround for #1100117: # Actually, on Aqua we probably shouldn't stipple images in @@ -67,40 +84,6 @@ namespace eval ttk::theme::aqua { disabled systemDisabledControlTextColor selected systemSelectedTabTextColor} - # Combobox: - ttk::style configure TCombobox \ - -foreground systemTextColor \ - -background systemTransparent - ttk::style map TCombobox \ - -foreground { - disabled systemDisabledControlTextColor - } \ - -selectforeground { - background systemTextColor - } \ - -selectbackground { - background systemTransparent - } - - # Spinbox - ttk::style configure TSpinbox \ - -foreground systemTextColor \ - -background systemTextBackgroundColor \ - -selectforeground systemSelectedTextColor \ - -selectbackground systemSelectedTextBackgroundColor - ttk::style map TSpinbox \ - -foreground { - disabled systemDisabledControlTextColor - } \ - -selectforeground { - !active systemTextColor - } \ - -selectbackground { - !active systemTextBackgroundColor - !focus systemTextBackgroundColor - focus systemSelectedTextBackgroundColor - } - # Treeview: ttk::style configure Heading \ -font TkHeadingFont \ |