2024-10-16 20:38:36 +02:00
|
|
|
# Copyright © 2021 rdbende <rdbende@gmail.com>
|
2024-10-18 22:33:20 +02:00
|
|
|
# inspired by rdbende modified azure to water by Désire Werner Menrath polunga40@unity-mail.de 2024
|
2024-10-16 20:38:36 +02:00
|
|
|
|
|
|
|
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"} {
|
2024-10-18 22:33:20 +02:00
|
|
|
ttk::style theme use "water-dark"
|
2024-10-16 20:38:36 +02:00
|
|
|
|
|
|
|
array set colors {
|
|
|
|
-fg "#ffffff"
|
|
|
|
-bg "#333333"
|
|
|
|
-disabledfg "#ffffff"
|
|
|
|
-disabledbg "#737373"
|
2024-10-18 22:33:20 +02:00
|
|
|
-selectfg "#000000"
|
2024-10-16 20:38:36 +02:00
|
|
|
-selectbg "#00c4ff"
|
|
|
|
}
|
|
|
|
|
|
|
|
ttk::style configure . \
|
|
|
|
-background $colors(-bg) \
|
|
|
|
-foreground $colors(-fg) \
|
|
|
|
-troughcolor $colors(-bg) \
|
|
|
|
-focuscolor $colors(-selectbg) \
|
|
|
|
-selectbackground $colors(-selectbg) \
|
|
|
|
-selectforeground $colors(-selectfg) \
|
|
|
|
-insertcolor $colors(-fg) \
|
|
|
|
-insertwidth 1 \
|
|
|
|
-fieldbackground $colors(-selectbg) \
|
|
|
|
-font {"Segoe Ui" 10} \
|
|
|
|
-borderwidth 1 \
|
|
|
|
-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 $colors(-disabledfg)]
|
|
|
|
|
|
|
|
option add *font [ttk::style lookup . -font]
|
|
|
|
option add *Menu.selectcolor $colors(-fg)
|
|
|
|
|
|
|
|
} elseif {$mode == "light"} {
|
2024-10-18 22:33:20 +02:00
|
|
|
ttk::style theme use "water-light"
|
2024-10-16 20:38:36 +02:00
|
|
|
|
|
|
|
array set colors {
|
|
|
|
-fg "#000000"
|
|
|
|
-bg "#ffffff"
|
|
|
|
-disabledfg "#737373"
|
|
|
|
-disabledbg "#ffffff"
|
2024-10-18 22:33:20 +02:00
|
|
|
-selectfg "#000000"
|
2024-10-16 20:38:36 +02:00
|
|
|
-selectbg "#00c4ff"
|
|
|
|
}
|
|
|
|
|
|
|
|
ttk::style configure . \
|
|
|
|
-background $colors(-bg) \
|
|
|
|
-foreground $colors(-fg) \
|
|
|
|
-troughcolor $colors(-bg) \
|
|
|
|
-focuscolor $colors(-selectbg) \
|
|
|
|
-selectbackground $colors(-selectbg) \
|
|
|
|
-selectforeground $colors(-selectfg) \
|
|
|
|
-insertcolor $colors(-fg) \
|
|
|
|
-insertwidth 1 \
|
|
|
|
-fieldbackground $colors(-selectbg) \
|
|
|
|
-font {"Segoe Ui" 10} \
|
|
|
|
-borderwidth 1 \
|
|
|
|
-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 $colors(-disabledfg)]
|
|
|
|
|
|
|
|
option add *font [ttk::style lookup . -font]
|
|
|
|
option add *Menu.selectcolor $colors(-fg)
|
|
|
|
}
|
|
|
|
}
|