-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsun-valley.tcl
executable file
·96 lines (82 loc) · 3.63 KB
/
sun-valley.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Copyright © 2021 rdbende <rdbende@gmail.com>
source [file join [file dirname [info script]] theme light.tcl]
source [file join [file dirname [info script]] theme dark.tcl]
option add *tearOff 0
proc set_theme {mode} {
if {$mode == "dark"} {
ttk::style theme use "sun-valley-dark"
namespace eval themeColors {
set fg "#ffffff"
set bg "#1c1c1c"
set disabledFg "#595959"
set selectFg "#ffffff"
set selectBg "#2f60d8"
set dialogInfoBg "#2b2b2b"
set menuBg "#2f2f2f"
set treeSelectBg "#292929"
}
ttk::style configure . \
-background $themeColors::bg \
-foreground $themeColors::fg \
-troughcolor $themeColors::bg \
-focuscolor $themeColors::selectBg \
-selectbackground $themeColors::selectBg \
-selectforeground $themeColors::selectFg \
-insertwidth 1 \
-insertcolor $themeColors::fg \
-fieldbackground $themeColors::bg \
-font {"Segoe UI" 10} \
-borderwidth 0 \
-relief flat
tk_setPalette \
background [ttk::style lookup . -background] \
foreground [ttk::style lookup . -foreground] \
highlightColor [ttk::style lookup . -focuscolor] \
selectBackground [ttk::style lookup . -selectbackground] \
selectForeground [ttk::style lookup . -selectforeground] \
activeBackground [ttk::style lookup . -selectbackground] \
activeForeground [ttk::style lookup . -selectforeground]
ttk::style map . -foreground [list disabled $themeColors::disabledFg]
option add *font [ttk::style lookup . -font]
option add *Menu.selectcolor $themeColors::fg
option add *Menu.background $themeColors::menuBg
} elseif {$mode == "light"} {
ttk::style theme use "sun-valley-light"
namespace eval themeColors {
set fg "#202020"
set bg "#fafafa"
set disabledFg "#a0a0a0"
set selectFg "#ffffff"
set selectBg "#2f60d8"
set dialogInfoBg "#ffffff"
set menuBg "#e7e7e7"
set treeSelectFg "#191919"
set treeSelectBg "#f0f0f0"
}
ttk::style configure . \
-background $themeColors::bg \
-foreground $themeColors::fg \
-troughcolor $themeColors::bg \
-focuscolor $themeColors::selectBg \
-selectbackground $themeColors::selectBg \
-selectforeground $themeColors::selectFg \
-insertwidth 1 \
-insertcolor $themeColors::fg \
-fieldbackground $themeColors::bg \
-font {"Segoe UI" 10} \
-borderwidth 0 \
-relief flat
tk_setPalette \
background [ttk::style lookup . -background] \
foreground [ttk::style lookup . -foreground] \
highlightColor [ttk::style lookup . -focuscolor] \
selectBackground [ttk::style lookup . -selectbackground] \
selectForeground [ttk::style lookup . -selectforeground] \
activeBackground [ttk::style lookup . -selectbackground] \
activeForeground [ttk::style lookup . -selectforeground]
ttk::style map . -foreground [list disabled $themeColors::disabledFg]
option add *font [ttk::style lookup . -font]
option add *Menu.selectcolor $themeColors::fg
option add *Menu.background $themeColors::menuBg
}
}