diff options
author | jenglish <jenglish@flightlab.com> | 2006-12-13 17:06:31 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2006-12-13 17:06:31 (GMT) |
commit | 94acb8d71c38b7e493d498a69816f77b520f49f1 (patch) | |
tree | 5750b2c23f77580621592431250ee7f66a508fd7 /library/ttk/clamTheme.tcl | |
parent | b7c21ec7f3c632eb27c460678d7382bf05eb1d38 (diff) | |
download | tk-94acb8d71c38b7e493d498a69816f77b520f49f1.zip tk-94acb8d71c38b7e493d498a69816f77b520f49f1.tar.gz tk-94acb8d71c38b7e493d498a69816f77b520f49f1.tar.bz2 |
Try to straighten out theme loading and selection logic.
Diffstat (limited to 'library/ttk/clamTheme.tcl')
-rw-r--r-- | library/ttk/clamTheme.tcl | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index abf979f..9061006 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -1,16 +1,14 @@ # -# $Id: clamTheme.tcl,v 1.2 2006/11/24 18:04:14 jenglish Exp $ +# $Id: clamTheme.tcl,v 1.3 2006/12/13 17:06:32 jenglish Exp $ # -# Ttk widget set: "Clam" theme +# "Clam" theme. # # Inspired by the XFCE family of Gnome themes. # namespace eval ttk::theme::clam { - - package provide ttk::theme::clam 0.0.1 - - variable colors ; array set colors { + variable colors + array set colors { -disabledfg "#999999" -frame "#dcdad5" @@ -23,10 +21,9 @@ namespace eval ttk::theme::clam { -selectfg "#ffffff" } - namespace import -force ::ttk::style - style theme settings clam { + ttk::style theme settings clam { - style configure "." \ + ttk::style configure "." \ -background $colors(-frame) \ -foreground black \ -bordercolor $colors(-darkest) \ @@ -39,7 +36,7 @@ namespace eval ttk::theme::clam { -font TkDefaultFont \ ; - style map "." \ + ttk::style map "." \ -background [list disabled $colors(-frame) \ active $colors(-lighter)] \ -foreground [list disabled $colors(-disabledfg)] \ @@ -48,8 +45,8 @@ namespace eval ttk::theme::clam { ; # -selectbackground [list !focus "#847d73"] - style configure TButton -width -11 -padding 5 -relief raised - style map TButton \ + ttk::style configure TButton -width -11 -padding 5 -relief raised + ttk::style map TButton \ -background [list \ disabled $colors(-frame) \ pressed $colors(-darker) \ @@ -59,42 +56,47 @@ namespace eval ttk::theme::clam { -bordercolor [list alternate "#000000"] \ ; - style configure Toolbutton -padding 2 -relief flat - style map Toolbutton \ - -relief {disabled flat selected sunken pressed sunken active raised} \ - -background [list disabled $colors(-frame) \ - pressed $colors(-darker) \ - active $colors(-lighter)] \ + ttk::style configure Toolbutton -padding 2 -relief flat + ttk::style map Toolbutton \ + -relief [list \ + disabled flat \ + selected sunken \ + pressed sunken \ + active raised] \ + -background [list \ + disabled $colors(-frame) \ + pressed $colors(-darker) \ + active $colors(-lighter)] \ -lightcolor [list pressed $colors(-darker)] \ -darkcolor [list pressed $colors(-darker)] \ ; - style configure TCheckbutton \ + ttk::style configure TCheckbutton \ -indicatorbackground "#ffffff" \ -indicatormargin {1 1 4 1} \ -padding 2 ; - style configure TRadiobutton \ + ttk::style configure TRadiobutton \ -indicatorbackground "#ffffff" \ -indicatormargin {1 1 4 1} \ -padding 2 ; - style map TCheckbutton -indicatorbackground \ + ttk::style map TCheckbutton -indicatorbackground \ [list disabled $colors(-frame) pressed $colors(-frame)] - style map TRadiobutton -indicatorbackground \ + ttk::style map TRadiobutton -indicatorbackground \ [list disabled $colors(-frame) pressed $colors(-frame)] - style configure TMenubutton \ + ttk::style configure TMenubutton \ -width -11 -padding 5 -relief raised -anchor w - style configure TEntry -padding 1 -insertwidth 1 - style map TEntry \ + ttk::style configure TEntry -padding 1 -insertwidth 1 + ttk::style map TEntry \ -background [list readonly $colors(-frame)] \ -bordercolor [list focus $colors(-selectbg)] \ -lightcolor [list focus "#6f9dc6"] \ -darkcolor [list focus "#6f9dc6"] \ ; - style configure TCombobox -padding 1 -insertwidth 1 - style map TCombobox \ + ttk::style configure TCombobox -padding 1 -insertwidth 1 + ttk::style map TCombobox \ -background [list active $colors(-lighter) \ pressed $colors(-lighter)] \ -fieldbackground [list {readonly focus} $colors(-selectbg) \ @@ -102,19 +104,19 @@ namespace eval ttk::theme::clam { -foreground [list {readonly focus} $colors(-selectfg)] \ ; - style configure TNotebook.Tab -padding {6 2 6 2} - style map TNotebook.Tab \ + ttk::style configure TNotebook.Tab -padding {6 2 6 2} + ttk::style map TNotebook.Tab \ -padding [list selected {6 4 6 2}] \ -background [list selected $colors(-frame) {} $colors(-darker)] \ -lightcolor [list selected $colors(-lighter) {} $colors(-dark)] \ ; - style configure TLabelframe \ + ttk::style configure TLabelframe \ -labeloutside true -labelmargins {0 0 0 4} \ -borderwidth 2 -relief raised - style configure TProgressbar -background $colors(-frame) + ttk::style configure TProgressbar -background $colors(-frame) - style configure Sash -sashthickness 6 -gripcount 10 + ttk::style configure Sash -sashthickness 6 -gripcount 10 } } |