diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-02-08 12:15:33 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-02-08 12:15:33 (GMT) |
commit | c1e88bbe11ef48d56582012c4a8e00146281789b (patch) | |
tree | e8b5fc8abc6972e68ce3e73476fd719a0380e5c0 /library | |
parent | f68672e37b0cf0667b7263dcd051ee2507c29e9d (diff) | |
parent | 6eab94ca4508577b6f280ac96e55146bb790b8dc (diff) | |
download | tk-c1e88bbe11ef48d56582012c4a8e00146281789b.zip tk-c1e88bbe11ef48d56582012c4a8e00146281789b.tar.gz tk-c1e88bbe11ef48d56582012c4a8e00146281789b.tar.bz2 |
Merge 8.7
Diffstat (limited to 'library')
-rw-r--r-- | library/ttk/altTheme.tcl | 7 | ||||
-rw-r--r-- | library/ttk/clamTheme.tcl | 7 | ||||
-rw-r--r-- | library/ttk/classicTheme.tcl | 7 | ||||
-rw-r--r-- | library/ttk/defaults.tcl | 12 | ||||
-rw-r--r-- | library/ttk/ttk.tcl | 57 | ||||
-rw-r--r-- | library/ttk/vistaTheme.tcl | 2 | ||||
-rw-r--r-- | library/ttk/winTheme.tcl | 5 | ||||
-rw-r--r-- | library/ttk/xpTheme.tcl | 5 |
8 files changed, 62 insertions, 40 deletions
diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl index a9b8748..26708b7 100644 --- a/library/ttk/altTheme.tcl +++ b/library/ttk/altTheme.tcl @@ -95,10 +95,13 @@ namespace eval ttk::theme::alt { # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised + ttk::style configure Item -diameter 6.75p \ + -indicatormargins {1.5p 1.5p 3p 1.5p} ttk::style configure Treeview -background $colors(-window) \ - -stripedbackground $colors(-alternate) + -stripedbackground $colors(-alternate) -indent 15p + ttk::setTreeviewRowHeight ttk::style configure Treeview.Separator \ - -background $colors(-alternate) + -background $colors(-alternate) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ selected $colors(-selectbg)] \ diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index c0c4039..b968677 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -128,10 +128,13 @@ namespace eval ttk::theme::clam { # Treeview: ttk::style configure Heading \ -font TkHeadingFont -relief raised -padding 2.25p + ttk::style configure Item -indicatorsize 9p \ + -indicatormargins {1.5p 1.5p 3p 1.5p} ttk::style configure Treeview -background $colors(-window) \ - -stripedbackground $colors(-lighter) + -stripedbackground $colors(-lighter) -indent 15p + ttk::setTreeviewRowHeight ttk::style configure Treeview.Separator \ - -background $colors(-lighter) + -background $colors(-lighter) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ selected $colors(-selectbg)] \ diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index dc02134..7235b2b 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -103,10 +103,13 @@ namespace eval ttk::theme::classic { # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised + ttk::style configure Item -indicatorsize 9p \ + -indicatormargins {1.5p 1.5p 3p 1.5p} ttk::style configure Treeview -background $colors(-window) \ - -stripedbackground $colors(-alternate) + -stripedbackground $colors(-alternate) -indent 15p + ttk::setTreeviewRowHeight ttk::style configure Treeview.Separator \ - -background $colors(-alternate) + -background $colors(-alternate) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ selected $colors(-selectbg)] \ diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 2cf2b54..ba851cb 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -116,7 +116,8 @@ proc ttk::theme::default::reconfigureDefaultTheme {} { ttk::style configure TCheckbutton \ -indicatorcolor $colors(-window) -indicatorrelief sunken \ - -indicatordiameter 7.5p -indicatormargin {0 1.5p 3p 1.5p} -padding 0.75p + -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) \ @@ -128,7 +129,8 @@ proc ttk::theme::default::reconfigureDefaultTheme {} { ttk::style configure TRadiobutton \ -indicatorcolor $colors(-window) -indicatorrelief sunken \ - -indicatordiameter 7.5p -indicatormargin {0 1.5p 3p 1.5p} -padding 0.75p + -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) \ @@ -182,11 +184,15 @@ proc ttk::theme::default::reconfigureDefaultTheme {} { # Treeview. # ttk::style configure Heading -font TkHeadingFont -relief raised + ttk::style configure Item -indicatorsize 9p \ + -indicatormargins {1.5p 1.5p 3p 1.5p} ttk::style configure Treeview \ -background $colors(-window) \ -stripedbackground $colors(-alternate) \ -fieldbackground $colors(-window) \ - -foreground $colors(-text) ; + -foreground $colors(-text) \ + -indent 15p + ttk::setTreeviewRowHeight ttk::style configure Treeview.Separator \ -background $colors(-alternate) ttk::style map Treeview \ diff --git a/library/ttk/ttk.tcl b/library/ttk/ttk.tcl index 90720aa..cbf1303 100644 --- a/library/ttk/ttk.tcl +++ b/library/ttk/ttk.tcl @@ -95,6 +95,34 @@ proc ::ttk::setTheme {theme} { set currentTheme $theme } +## ttk::setTreeviewRowHeight -- +# Sets the default height of the ttk::treeview rows for the current theme. +# To be invoked from within the library files for the built-in themes. +# +proc ::ttk::setTreeviewRowHeight {} { + set font [::ttk::style lookup Treeview -font] + if {$font eq {}} { + set font TkDefaultFont + } + + ::ttk::style configure Treeview -rowheight \ + [expr {[font metrics $font -linespace] + 2}] +} + +# Applications should make sure that the ttk::setTreeviewRowHeight +# procedure will be invoked whenever the virtual event <<ThemeChanged>> +# is received (e.g., because the value of the Treeview style's -font +# option has changed), or the virtual event <<TkWorldChanged>> with +# the user_data field (%d) set to "FontChanged" is received. Example: +# +# bindtags . [linsert [bindtags .] 1 MyMainWin] +# bind MyMainWin <<ThemeChanged>> ttk::setTreeviewRowHeight +# bind MyMainWin <<TkWorldChanged>> { +# if {"%d" eq "FontChanged"} { +# ttk::setTreeviewRowHeight +# } +# } + ### Load widget bindings. # source -encoding utf-8 [file join $::ttk::library button.tcl] @@ -177,33 +205,4 @@ ttk::setTheme [ttk::DefaultTheme] ; rename ttk::DefaultTheme {} option add *TScale.length 75p widgetDefault option add *TProgressbar.length 75p widgetDefault -## ttk::SetTreeviewRowHeight -- -# Sets the default height of the ttk::treeview rows. -# -proc ttk::SetTreeviewRowHeight {} { - set font [::ttk::style lookup Treeview -font] - if {$font eq {}} { - set font TkDefaultFont - } - - ::ttk::style configure Treeview -rowheight \ - [expr {[font metrics $font -linespace] + 2}] -} - -ttk::SetTreeviewRowHeight - -# Applications should make sure that the ttk::SetTreeviewRowHeight -# procedure will be invoked whenever the virtual event <<ThemeChanged>> -# is received (e.g., because the value of the Treeview style's -font -# option has changed), or the virtual event <<TkWorldChanged>> with -# the user_data field (%d) set to "FontChanged" is received. Example: -# -# bindtags . [linsert [bindtags .] 1 MyMainWin] -# bind MyMainWin <<ThemeChanged>> ttk::SetTreeviewRowHeight -# bind MyMainWin <<TkWorldChanged>> { -# if {"%d" eq "FontChanged"} { -# ttk::SetTreeviewRowHeight -# } -# } - #*EOF* diff --git a/library/ttk/vistaTheme.tcl b/library/ttk/vistaTheme.tcl index 288ec97..d402bd4 100644 --- a/library/ttk/vistaTheme.tcl +++ b/library/ttk/vistaTheme.tcl @@ -222,6 +222,8 @@ namespace eval ttk::theme::vista { # Treeview ttk::style configure Item -padding {3p 0 0 0} + ttk::style configure Treeview -indent 15p + ttk::setTreeviewRowHeight package provide ttk::theme::vista 1.0 } diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl index 9fe65be..834d177 100644 --- a/library/ttk/winTheme.tcl +++ b/library/ttk/winTheme.tcl @@ -70,8 +70,11 @@ namespace eval ttk::theme::winnative { # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised + ttk::style configure Item -diameter 6.75p \ + -indicatormargins {1.5p 1.5p 3p 1.5p} ttk::style configure Treeview -background SystemWindow \ - -stripedbackground System3dLight + -stripedbackground System3dLight -indent 15p + ttk::setTreeviewRowHeight ttk::style map Treeview \ -background [list disabled SystemButtonFace \ selected SystemHighlight] \ diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl index 6b4e972..12ae979 100644 --- a/library/ttk/xpTheme.tcl +++ b/library/ttk/xpTheme.tcl @@ -52,8 +52,11 @@ namespace eval ttk::theme::xpnative { # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised + ttk::style configure Item -diameter 6.75p \ + -indicatormargins {1.5p 1.5p 3p 1.5p} ttk::style configure Treeview -background SystemWindow \ - -stripedbackground System3dLight + -stripedbackground System3dLight -indent 15p + ttk::setTreeviewRowHeight ttk::style map Treeview \ -background [list disabled SystemButtonFace \ selected SystemHighlight] \ |