From f6a56d017db0a2e4ecd0f4384203bb7415a960b1 Mon Sep 17 00:00:00 2001 From: rdbende Date: Mon, 18 Jul 2022 13:45:25 +0200 Subject: [PATCH] Update black theme --- ttkthemes/themes/black/black.tcl | 83 ++++++++++++++------------------ 1 file changed, 35 insertions(+), 48 deletions(-) diff --git a/ttkthemes/themes/black/black.tcl b/ttkthemes/themes/black/black.tcl index d140254..639ed36 100644 --- a/ttkthemes/themes/black/black.tcl +++ b/ttkthemes/themes/black/black.tcl @@ -1,13 +1,10 @@ # black.tcl - # -# Experimental! -# # Copyright (c) 2007-2008 Mats Bengtsson # # $Id: black.tcl,v 1.2 2009/10/25 19:21:30 oberdorfer Exp $ -package require Tk 8.4; # minimum version for Tile -package require tile 0.8; # depends upon tile +package require Tk 8.6 namespace eval ttk { @@ -19,15 +16,8 @@ namespace eval ttk { } namespace eval ttk::theme::black { - - #variable imgdir [file join [file dirname [info script]] black] - #variable I - #array set I [tile::LoadImages $imgdir *.png] - variable dir [file dirname [info script]] - # NB: These colors must be in sync with the ones in black.rdb - variable colors array set colors { -disabledfg "DarkGrey" @@ -35,11 +25,13 @@ namespace eval ttk::theme::black { -dark "#222222" -darker "#121212" -darkest "black" - -lighter "#626262" - -lightest "#ffffff" + -light "#626262" + -lighter "#a9a9a9" + -lightest "white" -selectbg "#4a6984" - -selectfg "#ffffff" + -selectfg "white" } + if {[info commands ::ttk::style] ne ""} { set styleCmd ttk::style } else { @@ -53,55 +45,45 @@ namespace eval ttk::theme::black { # $styleCmd configure "." \ -background $colors(-frame) \ - -foreground white \ + -foreground $colors(-lightest) \ -bordercolor $colors(-darkest) \ -darkcolor $colors(-dark) \ - -lightcolor $colors(-lighter) \ + -lightcolor $colors(-light) \ -troughcolor $colors(-darker) \ -selectbackground $colors(-selectbg) \ -selectforeground $colors(-selectfg) \ -selectborderwidth 0 \ - -font TkDefaultFont \ - ; + -arrowcolor $colors(-lighter) \ + -indicatorbackground $colors(-lighter) \ + -insertcolor $colors(-lightest) \ + -font TkDefaultFont $styleCmd map "." \ - -background [list disabled $colors(-frame) \ - active $colors(-lighter)] \ + -background [list disabled $colors(-frame) active $colors(-light)] \ -foreground [list disabled $colors(-disabledfg)] \ - -selectbackground [list !focus $colors(-darkest)] \ - -selectforeground [list !focus white] \ - ; + -selectbackground [list !focus $colors(-darkest)] \ + -selectforeground [list !focus white] # ttk widgets. - $styleCmd configure TButton \ - -width -8 -padding {5 1} -relief raised - $styleCmd configure TMenubutton \ - -width -11 -padding {5 1} -relief raised - $styleCmd configure TCheckbutton \ - -indicatorbackground "#ffffff" -indicatormargin {1 1 4 1} - $styleCmd configure TRadiobutton \ - -indicatorbackground "#ffffff" -indicatormargin {1 1 4 1} + $styleCmd configure TButton -width -8 -padding {5 2} -relief raised + $styleCmd configure Toolbutton -width -8 -padding {5 2} + $styleCmd configure TMenubutton -width -11 -padding {5 2} -relief raised + + $styleCmd configure TCheckbutton -indicatormargin {1 1 4 1} + $styleCmd configure TRadiobutton -indicatormargin {1 1 4 1} $styleCmd configure TEntry \ - -fieldbackground white -foreground black \ - -padding {2 0} + -fieldbackground $colors(-light) -foreground $colors(-lightest) \ + -padding 4 $styleCmd configure TCombobox \ - -fieldbackground white -foreground black \ - -padding {2 0} + -fieldbackground $colors(-light) -foreground $colors(-lightest) \ + -padding 4 $styleCmd configure TSpinbox \ - -fieldbackground white -foreground black \ - -padding {2 0} + -fieldbackground $colors(-light) -foreground $colors(-lightest) \ + -padding 4 - $styleCmd configure TNotebook.Tab \ - -padding {6 2 6 2} - - $styleCmd map TNotebook.Tab -background [list \ - selected $colors(-lighter)] - - # tk widgets. - $styleCmd map Menu \ - -background [list active $colors(-lighter)] \ - -foreground [list disabled $colors(-disabledfg)] + $styleCmd configure TNotebook.Tab -padding {6 2 6 2} + $styleCmd map TNotebook.Tab -background [list selected $colors(-light)] $styleCmd configure TreeCtrl \ -background gray30 -itembackground {gray60 gray50} \ @@ -111,7 +93,12 @@ namespace eval ttk::theme::black { -background [list selected $colors(-selectbg)] \ -foreground [list selected $colors(-selectfg)] - $styleCmd configure Treeview -fieldbackground $colors(-lighter) + $styleCmd configure Treeview -fieldbackground $colors(-frame) + + # tk widgets. + $styleCmd map Menu \ + -background [list active $colors(-light)] \ + -foreground [list disabled $colors(-disabledfg)] } }