2022-11-11 16:22:50 +03:00
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
|
|
namespace eval ttk {
|
|
|
|
namespace eval theme {
|
|
|
|
namespace eval black {
|
|
|
|
variable version 0.1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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"
|
|
|
|
-frame "#424242"
|
|
|
|
-dark "#222222"
|
|
|
|
-darker "#121212"
|
|
|
|
-darkest "black"
|
|
|
|
-lighter "#626262"
|
|
|
|
-lightest "#ffffff"
|
|
|
|
-selectbg "#4a6984"
|
|
|
|
-selectfg "#ffffff"
|
|
|
|
}
|
|
|
|
if {[info commands ::ttk::style] ne ""} {
|
|
|
|
set styleCmd ttk::style
|
|
|
|
} else {
|
|
|
|
set styleCmd style
|
|
|
|
}
|
|
|
|
|
|
|
|
$styleCmd theme create black -parent clam -settings {
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Theme defaults
|
|
|
|
#
|
|
|
|
$styleCmd configure "." \
|
|
|
|
-background $colors(-frame) \
|
|
|
|
-foreground white \
|
|
|
|
-bordercolor $colors(-darkest) \
|
|
|
|
-darkcolor $colors(-dark) \
|
|
|
|
-lightcolor $colors(-lighter) \
|
|
|
|
-troughcolor $colors(-darker) \
|
|
|
|
-selectbackground $colors(-selectbg) \
|
|
|
|
-selectforeground $colors(-selectfg) \
|
|
|
|
-selectborderwidth 0 \
|
2022-11-14 11:12:54 +03:00
|
|
|
-font "{Droid Sans Mono} 9" \
|
2022-11-11 16:22:50 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
$styleCmd map "." \
|
|
|
|
-background [list disabled $colors(-frame) \
|
|
|
|
active $colors(-lighter)] \
|
|
|
|
-foreground [list disabled $colors(-disabledfg)] \
|
|
|
|
-selectbackground [list !focus $colors(-darkest)] \
|
|
|
|
-selectforeground [list !focus white] \
|
|
|
|
;
|
|
|
|
|
|
|
|
# ttk widgets.
|
|
|
|
$styleCmd configure TButton \
|
2022-11-14 11:12:54 +03:00
|
|
|
-width -8 -padding {5 1} -relief link
|
|
|
|
$styleCmd configure TMenubutton\
|
|
|
|
-relief flat -arrowsize 0
|
2022-11-11 16:22:50 +03:00
|
|
|
$styleCmd configure TCheckbutton \
|
2022-11-14 11:12:54 +03:00
|
|
|
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
2022-11-11 16:22:50 +03:00
|
|
|
$styleCmd configure TRadiobutton \
|
2022-11-14 11:12:54 +03:00
|
|
|
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
2022-11-11 16:22:50 +03:00
|
|
|
|
|
|
|
$styleCmd configure TEntry \
|
2022-11-14 11:12:54 +03:00
|
|
|
-fieldbackground gray20 -foreground black \
|
|
|
|
-padding {2 0} -border -1
|
2022-11-11 16:22:50 +03:00
|
|
|
$styleCmd configure TCombobox \
|
|
|
|
-fieldbackground white -foreground black \
|
|
|
|
-padding {2 0}
|
|
|
|
$styleCmd configure TSpinbox \
|
|
|
|
-fieldbackground white -foreground black \
|
|
|
|
-padding {2 0}
|
|
|
|
|
|
|
|
$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 TreeCtrl \
|
|
|
|
-background gray30 -itembackground {gray60 gray50} \
|
|
|
|
-itemfill white -itemaccentfill yellow
|
|
|
|
|
|
|
|
$styleCmd map Treeview \
|
2022-11-14 11:12:54 +03:00
|
|
|
-background [list selected $colors(-lighter)] \
|
2022-11-11 16:22:50 +03:00
|
|
|
-foreground [list selected $colors(-selectfg)]
|
2022-11-14 11:12:54 +03:00
|
|
|
# -background [list selected $colors(-selectbg)] \
|
2022-11-11 16:22:50 +03:00
|
|
|
|
2022-11-14 11:12:54 +03:00
|
|
|
$styleCmd configure Treeview -fieldbackground gray25
|
2022-11-11 16:22:50 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# A few tricks for Tablelist.
|
|
|
|
|
|
|
|
namespace eval ::tablelist:: {
|
|
|
|
|
|
|
|
proc blackTheme {} {
|
|
|
|
variable themeDefaults
|
|
|
|
|
|
|
|
array set colors [array get ttk::theme::black::colors]
|
|
|
|
|
|
|
|
array set themeDefaults [list \
|
|
|
|
-background "Black" \
|
|
|
|
-foreground "White" \
|
|
|
|
-disabledforeground $colors(-disabledfg) \
|
|
|
|
-stripebackground "#191919" \
|
|
|
|
-selectbackground "#4a6984" \
|
|
|
|
-selectforeground "DarkRed" \
|
|
|
|
-selectborderwidth 0 \
|
|
|
|
-font TkTextFont \
|
|
|
|
-labelbackground $colors(-frame) \
|
|
|
|
-labeldisabledBg "#dcdad5" \
|
|
|
|
-labelactiveBg "#eeebe7" \
|
|
|
|
-labelpressedBg "#eeebe7" \
|
|
|
|
-labelforeground white \
|
|
|
|
-labeldisabledFg "#999999" \
|
|
|
|
-labelactiveFg white \
|
|
|
|
-labelpressedFg white \
|
|
|
|
-labelfont TkDefaultFont \
|
|
|
|
-labelborderwidth 2 \
|
|
|
|
-labelpady 1 \
|
|
|
|
-arrowcolor "" \
|
|
|
|
-arrowstyle sunken10x9 \
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
package provide ttk::theme::black $::ttk::theme::black::version
|