diff --git a/lib/gui.tcl b/lib/gui.tcl index efcf68c..3aada00 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -31,7 +31,10 @@ bind . Quit #ttk::style configure Custom.Treeview -foreground red #ttk::style configure Custom.Treeview -rowheight 20 -ttk::style theme use dark + +if [info exists default(theme)] { + ttk::style theme use $default(theme) +} # Панель инсрументов set frm_tool [ttk::frame .frm_tool] @@ -79,8 +82,11 @@ set tree_work [ -yscrollcommand [list $frm_work.vsb set] ] # table rows background colors -$tree_work tag configure dark -background $color(dark_table_bg) -$tree_work tag configure light -background $color(light_table_bg) + +if {[info exists default(theme)] == 1} { + $tree_work tag configure dark -background $color(dark_table_bg) + $tree_work tag configure light -background $color(light_table_bg) +} bind $tree_work Edit $tree tag configure selected -background white -foreground black @@ -113,3 +119,4 @@ pack $frm_tree $frm_work -side left -expand true -fill both + diff --git a/lib/theme.tcl b/lib/theme.tcl index 56f9387..5671a3f 100644 --- a/lib/theme.tcl +++ b/lib/theme.tcl @@ -30,3 +30,11 @@ # option add *ScrollableFrame.Background $editor(bg) interactive # option add *ScrolledWindow.Background $editor(bg) interactive + +if {[info exists default(theme)] == 1 && $default(theme) eq "dark"} { + set color(dark_table_bg) "#6f6f6f" + set color(light_table_bg) "#424242" +} else { + set color(dark_table_bg) "#e2e2e2" + set color(light_table_bg) "#ffffff" +} diff --git a/lib/ttk_theme_dark.tcl b/lib/ttk_theme_dark.tcl index e4c06c3..13a256d 100644 --- a/lib/ttk_theme_dark.tcl +++ b/lib/ttk_theme_dark.tcl @@ -139,3 +139,4 @@ namespace eval ::tablelist:: { + diff --git a/rac_gui.cfg b/rac_gui.cfg index 955c4aa..40d7a74 100644 --- a/rac_gui.cfg +++ b/rac_gui.cfg @@ -114,15 +114,13 @@ set default(auth) { os } - ## Раскоментировать строки и прописать свои значения если ## для Информационных Баз используются эти параметры #set default(infobase_user) "ib_user" #set default(infobase_pwd) "ib_password" -# цвета строк в таблице -#set color(dark_table_bg) "#e2e2e2" -#set color(light_table_bg) "#ffffff" -set color(dark_table_bg) "#6f6f6f" -set color(light_table_bg) "#424242" +# Используемая тема +# доступны: dark, clam, classic, default, alt +set default(theme) dark + diff --git a/rac_gui.tcl b/rac_gui.tcl index e78a029..5447115 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -110,4 +110,3 @@ if [file exists [file join $dir(work) 1c_srv_new.cfg]] { puts $servers_list } -