Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion sv_ttk/sv.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,21 @@ proc config_menus {w} {
}


proc fix_menus_on_windows {root} {
foreach w [winfo children $root] {
if {[winfo class $w] eq "Menu"} {
$w configure \
-background "SystemMenu" \
-foreground "SystemMenuText" \
-activebackground "SystemHighlight" \
-activeforeground "SystemHighlightText"
} else {
fix_menus_on_windows $w
}
}
}


proc configure_colors {} {
set theme [ttk::style theme use]
if {$theme == "sun-valley-dark"} {
Expand Down Expand Up @@ -120,11 +135,15 @@ proc configure_colors {} {

ttk::style map . -foreground [list disabled $ttk::theme::sv_light::colors(-disfg)]
}

if {[tk windowingsystem] == "win32"} {
fix_menus_on_windows .
}
}


bind [winfo class .] <<ThemeChanged>> {+configure_colors}
bind TEntry <<ThemeChanged>> {+config_entry_font %W}
bind TCombobox <<ThemeChanged>> {+config_entry_font %W}
bind TSpinbox <<ThemeChanged>> {+config_entry_font %W}
bind Menu <<ThemeChanged>> {+config_menus %W}
bind Menu <<ThemeChanged>> {+config_menus %W}
Loading