diff options
author | fvogel <fvogelnew1@free.fr> | 2019-01-01 16:30:11 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2019-01-01 16:30:11 (GMT) |
commit | 9d46acafed8ba7109f4c1b49eff4b12b7009f1fc (patch) | |
tree | 9f078242639d483bad012dcfc1cfeccc66b61a0d | |
parent | 23de751222730f4e3b2e403c433e7c94f400ee8e (diff) | |
download | tk-9d46acafed8ba7109f4c1b49eff4b12b7009f1fc.zip tk-9d46acafed8ba7109f4c1b49eff4b12b7009f1fc.tar.gz tk-9d46acafed8ba7109f4c1b49eff4b12b7009f1fc.tar.bz2 |
Better fix for [509cafafae]: ttk::treeview tag options ignored in 8.6.9. This solution was suggested by cjmcdonald: Revert [d378ad72], partially revert [07b0114e] (keep documentation of tag priority order), and remove the {!disabled !selected} statespec from the -background and -foreground state map of the ttk::treeview since they are not needed and provide regressions.
-rw-r--r-- | doc/ttk_treeview.n | 5 | ||||
-rw-r--r-- | generic/ttk/ttkTreeview.c | 13 | ||||
-rw-r--r-- | library/ttk/altTheme.tcl | 2 | ||||
-rw-r--r-- | library/ttk/aquaTheme.tcl | 2 | ||||
-rw-r--r-- | library/ttk/clamTheme.tcl | 2 | ||||
-rw-r--r-- | library/ttk/classicTheme.tcl | 2 | ||||
-rw-r--r-- | library/ttk/defaults.tcl | 2 | ||||
-rw-r--r-- | library/ttk/vistaTheme.tcl | 2 | ||||
-rw-r--r-- | library/ttk/winTheme.tcl | 2 | ||||
-rw-r--r-- | library/ttk/xpTheme.tcl | 2 |
10 files changed, 4 insertions, 30 deletions
diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index 6cb801e..96565a3 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -432,9 +432,8 @@ Specifies the font to use when drawing text. .\" ??? Maybe: .IP \-text .IP \fB\-image\fR Specifies the item image, in case the item's \fB\-image\fR option is empty. -.PP -Tag options \fB\-foreground\fR and \fB\-background\fR take precedence over -the style, except in the \fBselected\fR state. +.\" .PP +.\" \fI(@@@ TODO: sort out order of precedence for options)\fR .PP Tag priority is decided by the creation order: tags created first receive higher priority. diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index a1ee325..bef84f3 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1709,17 +1709,8 @@ static void PrepareItem( Ttk_Style style = Ttk_LayoutStyle(tv->core.layout); Ttk_State state = ItemState(tv, item); - /* - * Tag options have precedence over the style, unless in selected state. - */ - - if (state & TTK_STATE_SELECTED) { - Ttk_TagSetValues(tv->tree.tagTable, item->tagset, displayItem); - Ttk_TagSetApplyStyle(tv->tree.tagTable, style, state, displayItem); - } else { - Ttk_TagSetApplyStyle(tv->tree.tagTable, style, state, displayItem); - Ttk_TagSetValues(tv->tree.tagTable, item->tagset, displayItem); - } + Ttk_TagSetValues(tv->tree.tagTable, item->tagset, displayItem); + Ttk_TagSetApplyStyle(tv->tree.tagTable, style, state, displayItem); } /* + DrawCells -- diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl index 6fc76f8..80ef415 100644 --- a/library/ttk/altTheme.tcl +++ b/library/ttk/altTheme.tcl @@ -96,10 +96,8 @@ namespace eval ttk::theme::alt { ttk::style configure Treeview -background $colors(-window) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ - {!disabled !selected} $colors(-window) \ selected $colors(-selectbg)] \ -foreground [list disabled $colors(-disabledfg) \ - {!disabled !selected} black \ selected $colors(-selectfg)] ttk::style configure TScale \ diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl index d6be5a3..a548d65 100644 --- a/library/ttk/aquaTheme.tcl +++ b/library/ttk/aquaTheme.tcl @@ -42,11 +42,9 @@ namespace eval ttk::theme::aqua { ttk::style configure Treeview -rowheight 18 -background White ttk::style map Treeview \ -background [list disabled systemDialogBackgroundInactive \ - {!disabled !selected} systemWindowBody \ {selected background} systemHighlightSecondary \ selected systemHighlight] \ -foreground [list disabled systemModelessDialogInactiveText \ - {!disabled !selected} black \ selected systemModelessDialogActiveText] # Enable animation for ttk::progressbar widget: diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index 3c6f5c3..6935fc7 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -132,10 +132,8 @@ namespace eval ttk::theme::clam { ttk::style configure Treeview -background $colors(-window) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ - {!disabled !selected} $colors(-window) \ selected $colors(-selectbg)] \ -foreground [list disabled $colors(-disabledfg) \ - {!disabled !selected} black \ selected $colors(-selectfg)] ttk::style configure TLabelframe \ diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index fefdb99..f237fba 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -99,10 +99,8 @@ namespace eval ttk::theme::classic { ttk::style configure Treeview -background $colors(-window) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ - {!disabled !selected} $colors(-window) \ selected $colors(-selectbg)] \ -foreground [list disabled $colors(-disabledfg) \ - {!disabled !selected} black \ selected $colors(-selectfg)] # diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 4c1753d..a15d1d9 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -111,10 +111,8 @@ namespace eval ttk::theme::default { -foreground $colors(-text) ; ttk::style map Treeview \ -background [list disabled $colors(-frame)\ - {!disabled !selected} $colors(-window) \ selected $colors(-selectbg)] \ -foreground [list disabled $colors(-disabledfg) \ - {!disabled !selected} black \ selected $colors(-selectfg)] # Combobox popdown frame diff --git a/library/ttk/vistaTheme.tcl b/library/ttk/vistaTheme.tcl index ecb39c9..094288c 100644 --- a/library/ttk/vistaTheme.tcl +++ b/library/ttk/vistaTheme.tcl @@ -48,10 +48,8 @@ namespace eval ttk::theme::vista { ttk::style configure Treeview -background SystemWindow ttk::style map Treeview \ -background [list disabled SystemButtonFace \ - {!disabled !selected} SystemWindow \ selected SystemHighlight] \ -foreground [list disabled SystemGrayText \ - {!disabled !selected} SystemWindowText \ selected SystemHighlightText] # Label and Toolbutton diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl index a7a2c79..db05b45 100644 --- a/library/ttk/winTheme.tcl +++ b/library/ttk/winTheme.tcl @@ -74,10 +74,8 @@ namespace eval ttk::theme::winnative { ttk::style configure Treeview -background SystemWindow ttk::style map Treeview \ -background [list disabled SystemButtonFace \ - {!disabled !selected} SystemWindow \ selected SystemHighlight] \ -foreground [list disabled SystemGrayText \ - {!disabled !selected} SystemWindowText \ selected SystemHighlightText] ttk::style configure TProgressbar \ diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl index 5d8d09b..4c4f680 100644 --- a/library/ttk/xpTheme.tcl +++ b/library/ttk/xpTheme.tcl @@ -67,10 +67,8 @@ namespace eval ttk::theme::xpnative { ttk::style configure Treeview -background SystemWindow ttk::style map Treeview \ -background [list disabled SystemButtonFace \ - {!disabled !selected} SystemWindow \ selected SystemHighlight] \ -foreground [list disabled SystemGrayText \ - {!disabled !selected} SystemWindowText \ selected SystemHighlightText]; } } |