diff --git a/Changelog b/Changelog index 70328fe..c515d94 100644 --- a/Changelog +++ b/Changelog @@ -8,6 +8,14 @@ My standard System: Linux Mint 22 Cinnamon - for loops with lists replaced by List Comprehensions - Replace Download Button with Lx Tools installer + ### Added +01.08.2025 + - Replace Imagemanager with IconManager and remove ImageManager from wp_app_config.py + + - Logging improved + + + ### Added 02-07-2025 diff --git a/TK-Themes/theme/dark.tcl b/TK-Themes/theme/dark.tcl index 2ad09db..33b3d6f 100644 --- a/TK-Themes/theme/dark.tcl +++ b/TK-Themes/theme/dark.tcl @@ -1,539 +1,621 @@ -# Copyright (c) 2021 rdbende - -# inspired by rdbende modified azure to water by Désire Werner Menrath polunga40@unity-mail.de 2024 - -package require Tk 8.6 - -namespace eval ttk::theme::water-dark { - variable version 2.0 - package provide ttk::theme::water-dark $version - - ttk::style theme create water-dark -parent clam -settings { - proc load_images {imgdir} { - variable I - foreach file [glob -directory $imgdir *.png] { - set img [file tail [file rootname $file]] - set I($img) [image create photo -file $file -format png] - } - } - - load_images [file join [file dirname [info script]] dark] - - array set colors { - -fg "#ffffff" - -bg "#333333" - -disabledfg "#aaaaaa" - -disabledbg "#737373" - -selectfg "#ffffff" - -selectbg "#007fff" - } - - ttk::style layout TButton { - Button.button -children { - Button.padding -children { - Button.label -side left -expand true - } - } - } - - ttk::style layout Toolbutton { - Toolbutton.button -children { - Toolbutton.padding -children { - Toolbutton.label -side left -expand true - } - } - } - - ttk::style layout TMenubutton { - Menubutton.button -children { - Menubutton.padding -children { - Menubutton.indicator -side right - Menubutton.label -side right -expand true - } - } - } - - ttk::style layout TOptionMenu { - OptionMenu.button -children { - OptionMenu.padding -children { - OptionMenu.indicator -side right - OptionMenu.label -side right -expand true - } - } - } - - ttk::style layout Accent.TButton { - AccentButton.button -children { - AccentButton.padding -children { - AccentButton.label -side left -expand true - } - } - } - - ttk::style layout TCheckbutton { - Checkbutton.button -children { - Checkbutton.padding -children { - Checkbutton.indicator -side left - Checkbutton.label -side right -expand true - } - } - } - - ttk::style layout Switch.TCheckbutton { - Switch.button -children { - Switch.padding -children { - Switch.indicator -side left - Switch.label -side right -expand true - } - } - } - - ttk::style layout Toggle.TButton { - ToggleButton.button -children { - ToggleButton.padding -children { - ToggleButton.label -side left -expand true - } - } - } - - ttk::style layout TRadiobutton { - Radiobutton.button -children { - Radiobutton.padding -children { - Radiobutton.indicator -side left - Radiobutton.label -side right -expand true - } - } - } - - ttk::style layout Vertical.TScrollbar { - Vertical.Scrollbar.trough -sticky ns -children { - Vertical.Scrollbar.thumb -expand true - } - } - - ttk::style layout Horizontal.TScrollbar { - Horizontal.Scrollbar.trough -sticky ew -children { - Horizontal.Scrollbar.thumb -expand true - } - } - - ttk::style layout TCombobox { - Combobox.field -sticky nswe -children { - Combobox.padding -expand true -sticky nswe -children { - Combobox.textarea -sticky nswe - } - } - Combobox.button -side right -sticky ns -children { - Combobox.arrow -sticky nsew - } - } - - ttk::style layout TSpinbox { - Spinbox.field -sticky nsew -children { - Spinbox.padding -expand true -sticky nswe -children { - Spinbox.textarea -sticky nswe - } - - } - Spinbox.button -side right -sticky ns -children { - null -side right -children { - Spinbox.uparrow -side top - Spinbox.downarrow -side bottom - } - } - } - - ttk::style layout Horizontal.TSeparator { - Horizontal.separator -sticky nswe - } - - ttk::style layout Vertical.TSeparator { - Vertical.separator -sticky nswe - } - - ttk::style layout Horizontal.Tick.TScale { - Horizontal.TickScale.trough -sticky ew -children { - Horizontal.TickScale.slider -sticky w - } - } - - ttk::style layout Vertical.Tick.TScale { - Vertical.TickScale.trough -sticky ns -children { - Vertical.TickScale.slider -sticky n - } - } - - ttk::style layout Card.TFrame { - Card.field { - Card.padding -expand 1 - } - } - - ttk::style layout TLabelframe { - Labelframe.border { - Labelframe.padding -expand 1 -children { - Labelframe.label -side right - } - } - } - - ttk::style layout TNotebook.Tab { - Notebook.tab -children { - Notebook.padding -side top -children { - Notebook.label -side top -sticky {} - } - } - } - - ttk::style layout Treeview.Item { - Treeitem.padding -sticky nswe -children { - Treeitem.indicator -side left -sticky {} - Treeitem.image -side left -sticky {} - Treeitem.text -side left -sticky {} - } - } - - - # Elements - - # Button - ttk::style configure TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create Button.button image \ - [list $I(box-basic) \ - {selected disabled} $I(box-basic) \ - disabled $I(box-basic) \ - pressed $I(box-basic) \ - selected $I(box-basic) \ - active $I(button-hover) \ - focus $I(button-hover) \ - ] -border 4 -sticky ewns - - # Toolbutton - ttk::style configure Toolbutton -padding {8 4 8 4} -width -5 -anchor center - - ttk::style element create Toolbutton.button image \ - [list $I(empty) \ - {selected disabled} $I(empty) \ - disabled $I(empty) \ - pressed $I(rect-basic) \ - selected $I(rect-basic) \ - active $I(rect-basic) \ - ] -border 4 -sticky ewns - - # Menubutton - ttk::style configure TMenubutton -padding {8 4 4 4} - - ttk::style element create Menubutton.button \ - image [list $I(rect-basic) \ - disabled $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(button-hover) \ - ] -border 4 -sticky ewns - - ttk::style element create Menubutton.indicator \ - image [list $I(down) \ - active $I(down) \ - pressed $I(down) \ - disabled $I(down) \ - ] -width 15 -sticky e - - # OptionMenu - ttk::style configure TOptionMenu -padding {8 4 4 4} - - ttk::style element create OptionMenu.button \ - image [list $I(rect-basic) \ - disabled $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(button-hover) \ - ] -border 4 -sticky ewns - - ttk::style element create OptionMenu.indicator \ - image [list $I(down) \ - active $I(down) \ - pressed $I(down) \ - disabled $I(down) \ - ] -width 15 -sticky e - - # AccentButton - ttk::style configure Accent.TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create AccentButton.button image \ - [list $I(rect-accent) \ - {selected disabled} $I(rect-accent-hover) \ - disabled $I(rect-accent-hover) \ - pressed $I(rect-accent) \ - selected $I(rect-accent) \ - active $I(rect-accent-hover) \ - focus $I(rect-accent-hover) \ - ] -border 4 -sticky ewns - - # Checkbutton - ttk::style configure TCheckbutton -padding 4 - - ttk::style element create Checkbutton.indicator image \ - [list $I(box-basic) \ - {alternate disabled} $I(check-tri-basic) \ - {selected disabled} $I(check-basic) \ - disabled $I(box-basic) \ - {pressed alternate} $I(check-tri-hover) \ - {active alternate} $I(check-tri-hover) \ - alternate $I(check-tri-accent) \ - {pressed selected} $I(check-hover) \ - {active selected} $I(check-hover) \ - selected $I(check-accent) \ - {pressed !selected} $I(rect-hover) \ - active $I(box-hover) \ - ] -width 26 -sticky w - - # Switch - ttk::style element create Switch.indicator image \ - [list $I(off-basic) \ - {selected disabled} $I(on-basic) \ - disabled $I(off-basic) \ - {pressed selected} $I(on-accent) \ - {active selected} $I(on-accent) \ - selected $I(on-accent) \ - {pressed !selected} $I(off-basic) \ - active $I(off-basic) \ - ] -width 46 -sticky w - - # ToggleButton - ttk::style configure Toggle.TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create ToggleButton.button image \ - [list $I(rect-basic) \ - {selected disabled} $I(rect-accent-hover) \ - disabled $I(rect-basic) \ - {pressed selected} $I(rect-basic) \ - {active selected} $I(rect-accent) \ - selected $I(rect-accent) \ - {pressed !selected} $I(rect-accent) \ - active $I(rect-basic) \ - ] -border 4 -sticky ewns - - # Radiobutton - ttk::style configure TRadiobutton -padding 4 - - ttk::style element create Radiobutton.indicator image \ - [list $I(outline-basic) \ - {alternate disabled} $I(radio-tri-basic) \ - {selected disabled} $I(radio-basic) \ - disabled $I(outline-basic) \ - {pressed alternate} $I(radio-tri-hover) \ - {active alternate} $I(radio-tri-hover) \ - alternate $I(radio-tri-accent) \ - {pressed selected} $I(radio-hover) \ - {active selected} $I(radio-hover) \ - selected $I(radio-accent) \ - {pressed !selected} $I(circle-hover) \ - active $I(outline-hover) \ - ] -width 26 -sticky w - - # Scrollbar - ttk::style element create Horizontal.Scrollbar.trough image $I(hor-basic) \ - -sticky ew - - ttk::style element create Horizontal.Scrollbar.thumb \ - image [list $I(hor-accent) \ - disabled $I(hor-basic) \ - pressed $I(hor-hover) \ - active $I(hor-hover) \ - ] -sticky ew - - ttk::style element create Vertical.Scrollbar.trough image $I(vert-basic) \ - -sticky ns - - ttk::style element create Vertical.Scrollbar.thumb \ - image [list $I(vert-accent) \ - disabled $I(vert-basic) \ - pressed $I(vert-hover) \ - active $I(vert-hover) \ - ] -sticky ns - - # Scale - ttk::style element create Horizontal.Scale.trough image $I(scale-hor) \ - -border 5 -padding 0 - - ttk::style element create Horizontal.Scale.slider \ - image [list $I(circle-accent) \ - disabled $I(circle-basic) \ - pressed $I(circle-hover) \ - active $I(circle-hover) \ - ] -sticky {} - - ttk::style element create Vertical.Scale.trough image $I(scale-vert) \ - -border 5 -padding 0 - - ttk::style element create Vertical.Scale.slider \ - image [list $I(circle-accent) \ - disabled $I(circle-basic) \ - pressed $I(circle-hover) \ - active $I(circle-hover) \ - ] -sticky {} - - # Tickscale - ttk::style element create Horizontal.TickScale.trough image $I(scale-hor) \ - -border 5 -padding 0 - - ttk::style element create Horizontal.TickScale.slider \ - image [list $I(tick-hor-accent) \ - disabled $I(tick-hor-basic) \ - pressed $I(tick-hor-hover) \ - active $I(tick-hor-hover) \ - ] -sticky {} - - ttk::style element create Vertical.TickScale.trough image $I(scale-vert) \ - -border 5 -padding 0 - - ttk::style element create Vertical.TickScale.slider \ - image [list $I(tick-vert-accent) \ - disabled $I(tick-vert-basic) \ - pressed $I(tick-vert-hover) \ - active $I(tick-vert-hover) \ - ] -sticky {} - - # Progressbar - ttk::style element create Horizontal.Progressbar.trough image $I(hor-basic) \ - -sticky ew - - ttk::style element create Horizontal.Progressbar.pbar image $I(hor-accent) \ - -sticky ew - - ttk::style element create Vertical.Progressbar.trough image $I(vert-basic) \ - -sticky ns - - ttk::style element create Vertical.Progressbar.pbar image $I(vert-accent) \ - -sticky ns - - # Entry - ttk::style element create Entry.field \ - image [list $I(box-basic) \ - {focus hover} $I(box-accent) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} -sticky news - - # Combobox - ttk::style map TCombobox -selectbackground [list \ - {!focus} $colors(-selectbg) \ - {readonly hover} $colors(-selectbg) \ - {readonly focus} $colors(-selectbg) \ - ] - - ttk::style map TCombobox -selectforeground [list \ - {!focus} $colors(-selectfg) \ - {readonly hover} $colors(-selectfg) \ - {readonly focus} $colors(-selectfg) \ - ] - - ttk::style element create Combobox.field \ - image [list $I(box-basic) \ - {readonly disabled} $I(rect-basic) \ - {readonly pressed} $I(rect-basic) \ - {readonly focus hover} $I(button-hover) \ - {readonly focus} $I(button-hover) \ - {readonly hover} $I(button-hover) \ - {focus hover} $I(box-accent) \ - readonly $I(rect-basic) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} - - ttk::style element create Combobox.button \ - image [list $I(combo-button-basic) \ - {!readonly focus} $I(combo-button-focus) \ - {readonly focus} $I(combo-button-hover) \ - {readonly hover} $I(combo-button-hover) - ] -border 5 -padding {2 6 6 6} - - ttk::style element create Combobox.arrow image $I(down) \ - -width 15 -sticky e - - # Spinbox - ttk::style element create Spinbox.field \ - image [list $I(box-basic) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} -sticky news - - ttk::style element create Spinbox.uparrow \ - image [list $I(up) \ - disabled $I(up) \ - pressed $I(up-accent) \ - active $I(up-accent) \ - ] -border 4 -width 15 -sticky e - - ttk::style element create Spinbox.downarrow \ - image [list $I(down) \ - disabled $I(down) \ - pressed $I(down-accent) \ - active $I(down-accent) \ - ] -border 4 -width 15 -sticky e - - ttk::style element create Spinbox.button \ - image [list $I(combo-button-basic) \ - {!readonly focus} $I(combo-button-focus) \ - {readonly focus} $I(combo-button-hover) \ - {readonly hover} $I(combo-button-hover) - ] -border 5 -padding {2 6 6 6} - - # Sizegrip - ttk::style element create Sizegrip.sizegrip image $I(size) \ - -sticky ewns - - # Separator - ttk::style element create Horizontal.separator image $I(separator) - - ttk::style element create Vertical.separator image $I(separator) - - # Card - ttk::style element create Card.field image $I(card) \ - -border 10 -padding 4 -sticky news - - # Labelframe - ttk::style element create Labelframe.border image $I(card) \ - -border 5 -padding 4 -sticky news - - # Notebook - ttk::style element create Notebook.client \ - image $I(notebook) -border 5 - - ttk::style element create Notebook.tab \ - image [list $I(tab-disabled) \ - selected $I(tab-basic) \ - active $I(tab-hover) \ - ] -border 5 -padding {14 4} - - # Treeview - ttk::style element create Treeview.field image $I(card) \ - -border 5 - - ttk::style element create Treeheading.cell \ - image [list $I(tree-basic) \ - pressed $I(tree-pressed) - ] -border 5 -padding 4 -sticky ewns - - ttk::style element create Treeitem.indicator \ - image [list $I(right) \ - user2 $I(empty) \ - user1 $I(down) \ - ] -width 26 -sticky {} - - ttk::style configure Treeview -background $colors(-bg) - ttk::style configure Treeview.Item -padding {2 0 0 0} - ttk::style map Treeview \ - -background [list selected $colors(-selectbg)] \ - -foreground [list selected $colors(-selectfg)] - - # Panedwindow - # Insane hack to remove clam's ugly sash - ttk::style configure Sash -gripcount 0 - } -} +# Copyright (c) 2021 rdbende + +# inspired by rdbende modified azure to water by Désire Werner Menrath polunga40@unity-mail.de 2024 +# Update add New Style TButton.Borderless for Buttons without edge and without rounded corners by +# Désire Werner Menrath 28-07-2025 +# Add Update Progressbars Round ends on Horizontal and Vertikal + add small bars +# Désire Werner Menrath 30-07-2025 + +package require Tk 8.6 + +namespace eval ttk::theme::water-dark { + variable version 2.0 + package provide ttk::theme::water-dark $version + + ttk::style theme create water-dark -parent clam -settings { + proc load_images {imgdir} { + variable I + foreach file [glob -directory $imgdir *.png] { + set img [file tail [file rootname $file]] + set I($img) [image create photo -file $file -format png] + } + } + + load_images [file join [file dirname [info script]] dark] + + array set colors { + -fg "#ffffff" + -bg "#333333" + -disabledfg "#aaaaaa" + -disabledbg "#737373" + -selectfg "#ffffff" + -selectbg "#007fff" + } + + ttk::style layout TButton { + Button.button -children { + Button.padding -children { + Button.label -side left -expand true + } + } + } + + ttk::style layout Toolbutton { + Toolbutton.button -children { + Toolbutton.padding -children { + Toolbutton.label -side left -expand true + } + } + } + + ttk::style layout TMenubutton { + Menubutton.button -children { + Menubutton.padding -children { + Menubutton.indicator -side right + Menubutton.label -side right -expand true + } + } + } + + ttk::style layout TOptionMenu { + OptionMenu.button -children { + OptionMenu.padding -children { + OptionMenu.indicator -side right + OptionMenu.label -side right -expand true + } + } + } + + ttk::style layout Accent.TButton { + AccentButton.button -children { + AccentButton.padding -children { + AccentButton.label -side left -expand true + } + } + } + + ttk::style layout TCheckbutton { + Checkbutton.button -children { + Checkbutton.padding -children { + Checkbutton.indicator -side left + Checkbutton.label -side right -expand true + } + } + } + + ttk::style layout Switch.TCheckbutton { + Switch.button -children { + Switch.padding -children { + Switch.indicator -side left + Switch.label -side right -expand true + } + } + } + + ttk::style layout Toggle.TButton { + ToggleButton.button -children { + ToggleButton.padding -children { + ToggleButton.label -side left -expand true + } + } + } + + ttk::style layout TRadiobutton { + Radiobutton.button -children { + Radiobutton.padding -children { + Radiobutton.indicator -side left + Radiobutton.label -side right -expand true + } + } + } + + ttk::style layout Vertical.TScrollbar { + Vertical.Scrollbar.trough -sticky ns -children { + Vertical.Scrollbar.thumb -expand true + } + } + + ttk::style layout Horizontal.TScrollbar { + Horizontal.Scrollbar.trough -sticky ew -children { + Horizontal.Scrollbar.thumb -expand true + } + } + + ttk::style layout TEntry { + Combobox.field -sticky nswe -children { + Combobox.padding -expand true -sticky nswe -children { + Combobox.textarea -sticky nswe + } + } + } + + ttk::style layout TCombobox { + Combobox.field -sticky nswe -children { + Combobox.padding -expand true -sticky nswe -children { + Combobox.textarea -sticky nswe + } + } + Combobox.button -side right -sticky ns -children { + Combobox.arrow -sticky nsew + } + } + + ttk::style layout TSpinbox { + Spinbox.field -sticky nsew -children { + Spinbox.padding -expand true -sticky nswe -children { + Spinbox.textarea -sticky nswe + } + + } + Spinbox.button -side right -sticky ns -children { + null -side right -children { + Spinbox.uparrow -side top + Spinbox.downarrow -side bottom + } + } + } + + ttk::style layout Horizontal.TSeparator { + Horizontal.separator -sticky nswe + } + + ttk::style layout Vertical.TSeparator { + Vertical.separator -sticky nswe + } + + ttk::style layout Horizontal.Tick.TScale { + Horizontal.TickScale.trough -sticky ew -children { + Horizontal.TickScale.slider -sticky w + } + } + + ttk::style layout Vertical.Tick.TScale { + Vertical.TickScale.trough -sticky ns -children { + Vertical.TickScale.slider -sticky n + } + } + + ttk::style layout Card.TFrame { + Card.field { + Card.padding -expand 1 + } + } + + ttk::style layout TLabelframe { + Labelframe.border { + Labelframe.padding -expand 1 -children { + Labelframe.label -side right + } + } + } + + ttk::style layout TNotebook.Tab { + Notebook.tab -children { + Notebook.padding -side top -children { + Notebook.label -side top -sticky {} + } + } + } + + ttk::style layout Treeview.Item { + Treeitem.padding -sticky nswe -children { + Treeitem.indicator -side left -sticky {} + Treeitem.image -side left -sticky {} + Treeitem.text -side left -sticky {} + } + } + + + # Elements + + # Button + ttk::style configure TButton -padding {8 4 8 4} -width -10 -anchor center + + ttk::style element create Button.button image [list $I(box-basic) {selected disabled} $I(box-basic) disabled $I(box-basic) pressed $I(box-basic) selected $I(box-basic) active $I(button-hover) focus $I(box-basic) ] -border 4 -sticky ewns + + # Borderless Button + ttk::style configure TButton.Borderless -padding 0 -width -10 -anchor center + ttk::style element create BorderlessButton.button image \ + [list $I(empty) \ + active $I(button-borderless-hover) \ + pressed $I(button-borderless-hover) \ + focus $I(button-borderless-hover) \ + ] -border 0 -sticky ewns + ttk::style layout TButton.Borderless { + BorderlessButton.button -children { + Button.padding -children { + Button.label -side left -expand true + } + } + } + + # Toolbutton + ttk::style configure Toolbutton -padding {8 4 8 4} -width -5 -anchor center + + ttk::style element create Toolbutton.button image \ + [list $I(empty) \ + {selected disabled} $I(empty) \ + disabled $I(empty) \ + pressed $I(rect-basic) \ + selected $I(rect-basic) \ + active $I(rect-basic) \ + ] -border 4 -sticky ewns + + # TButton Borderless Round + ttk::style configure TButton.Borderless.Round -padding 0 -width -10 -anchor center + ttk::style element create TButton.Borderless.Round.button image \ + [list $I(empty) \ + {selected disabled} $I(empty) \ + disabled $I(empty) \ + selected $I(rect-basic) \ + pressed $I(rect-basic) \ + active $I(rect-basic) \ + ] -border 4 -sticky ewns + ttk::style layout TButton.Borderless.Round { + TButton.Borderless.Round.button -children { + Button.padding -children { + Button.label -side left -expand true + } + } + } + + # Menubutton + ttk::style configure TMenubutton -padding {8 4 4 4} + + ttk::style element create Menubutton.button \ + image [list $I(rect-basic) \ + disabled $I(rect-basic) \ + pressed $I(rect-basic) \ + active $I(button-hover) \ + ] -border 4 -sticky ewns + + ttk::style element create Menubutton.indicator \ + image [list $I(down) \ + active $I(down) \ + pressed $I(down) \ + disabled $I(down) \ + ] -width 15 -sticky e + + # OptionMenu + ttk::style configure TOptionMenu -padding {8 4 4 4} + + ttk::style element create OptionMenu.button \ + image [list $I(rect-basic) \ + disabled $I(rect-basic) \ + pressed $I(rect-basic) \ + active $I(button-hover) \ + ] -border 4 -sticky ewns + + ttk::style element create OptionMenu.indicator \ + image [list $I(down) \ + active $I(down) \ + pressed $I(down) \ + disabled $I(down) \ + ] -width 15 -sticky e + + # AccentButton + ttk::style configure Accent.TButton -padding {8 4 8 4} -width -10 -anchor center + + ttk::style element create AccentButton.button image \ + [list $I(rect-accent) \ + {selected disabled} $I(rect-accent-hover) \ + disabled $I(rect-accent-hover) \ + pressed $I(rect-accent) \ + selected $I(rect-accent) \ + active $I(rect-accent-hover) \ + focus $I(rect-accent) \ + ] -border 4 -sticky ewns + + # Checkbutton + ttk::style configure TCheckbutton -padding 4 + + ttk::style element create Checkbutton.indicator image \ + [list $I(box-basic) \ + {alternate disabled} $I(check-tri-basic) \ + {selected disabled} $I(check-basic) \ + disabled $I(box-basic) \ + {pressed alternate} $I(check-tri-hover) \ + {active alternate} $I(check-tri-hover) \ + alternate $I(check-tri-accent) \ + {pressed selected} $I(check-hover) \ + {active selected} $I(check-hover) \ + selected $I(check-accent) \ + {pressed !selected} $I(rect-hover) \ + active $I(box-hover) \ + ] -width 26 -sticky w + + # Switch + ttk::style element create Switch.indicator image \ + [list $I(off-basic) \ + {selected disabled} $I(on-basic) \ + disabled $I(off-basic) \ + {pressed selected} $I(on-accent) \ + {active selected} $I(on-accent) \ + selected $I(on-accent) \ + {pressed !selected} $I(off-basic) \ + active $I(off-basic) \ + ] -width 46 -sticky w + + # ToggleButton + ttk::style configure Toggle.TButton -padding {8 4 8 4} -width -10 -anchor center + + ttk::style element create ToggleButton.button image \ + [list $I(rect-basic) \ + {selected disabled} $I(rect-accent-hover) \ + disabled $I(rect-basic) \ + {pressed selected} $I(rect-basic) \ + {active selected} $I(rect-accent) \ + selected $I(rect-accent) \ + {pressed !selected} $I(rect-accent) \ + active $I(rect-basic) \ + ] -border 4 -sticky ewns + + # Radiobutton + ttk::style configure TRadiobutton -padding 4 + + ttk::style element create Radiobutton.indicator image \ + [list $I(outline-basic) \ + {alternate disabled} $I(radio-tri-basic) \ + {selected disabled} $I(radio-basic) \ + disabled $I(outline-basic) \ + {pressed alternate} $I(radio-tri-hover) \ + {active alternate} $I(radio-tri-hover) \ + alternate $I(radio-tri-accent) \ + {pressed selected} $I(radio-hover) \ + {active selected} $I(radio-hover) \ + selected $I(radio-accent) \ + {pressed !selected} $I(circle-hover) \ + active $I(outline-hover) \ + ] -width 26 -sticky w + + # Scrollbar + ttk::style element create Horizontal.Scrollbar.trough image $I(hor-basic) \ + -sticky ew + + ttk::style element create Horizontal.Scrollbar.thumb \ + image [list $I(hor-accent) \ + disabled $I(hor-basic) \ + pressed $I(hor-hover) \ + active $I(hor-hover) \ + ] -sticky ew + + ttk::style element create Vertical.Scrollbar.trough image $I(vert-basic) \ + -sticky ns + + ttk::style element create Vertical.Scrollbar.thumb \ + image [list $I(vert-accent) \ + disabled $I(vert-basic) \ + pressed $I(vert-hover) \ + active $I(vert-hover) \ + ] -sticky ns + + # Scale + ttk::style element create Horizontal.Scale.trough image $I(scale-hor) \ + -border 5 -padding 0 + + ttk::style element create Horizontal.Scale.slider \ + image [list $I(circle-accent) \ + disabled $I(circle-basic) \ + pressed $I(circle-hover) \ + active $I(circle-hover) \ + ] -sticky {} + + ttk::style element create Vertical.Scale.trough image $I(scale-vert) \ + -border 5 -padding 0 + + ttk::style element create Vertical.Scale.slider \ + image [list $I(circle-accent) \ + disabled $I(circle-basic) \ + pressed $I(circle-hover) \ + active $I(circle-hover) \ + ] -sticky {} + + # Tickscale + ttk::style element create Horizontal.TickScale.trough image $I(scale-hor) \ + -border 5 -padding 0 + + ttk::style element create Horizontal.TickScale.slider \ + image [list $I(tick-hor-accent) \ + disabled $I(tick-hor-basic) \ + pressed $I(tick-hor-hover) \ + active $I(tick-hor-hover) \ + ] -sticky {} + + ttk::style element create Vertical.TickScale.trough image $I(scale-vert) \ + -border 5 -padding 0 + + ttk::style element create Vertical.TickScale.slider \ + image [list $I(tick-vert-accent) \ + disabled $I(tick-vert-basic) \ + pressed $I(tick-vert-hover) \ + active $I(tick-vert-hover) \ + ] -sticky {} + + # Progressbar + ttk::style layout Horizontal.TProgressbar { + Horizontal.Progressbar.trough -children { + Horizontal.Progressbar.pbar + } + } + ttk::style layout Vertical.TProgressbar { + Vertical.Progressbar.trough -children { + Vertical.Progressbar.pbar + } + } + + ttk::style element create Horizontal.Progressbar.trough image $I(hor-trough) \ + -border 3 -padding 0 -sticky ew + + ttk::style element create Horizontal.Progressbar.pbar image $I(hor-pbar) \ + -border 3 -padding 0 -sticky ew + + ttk::style element create Vertical.Progressbar.trough image $I(vert-trough) \ + -border 3 -padding 0 -sticky ns + + ttk::style element create Vertical.Progressbar.pbar image $I(vert-pbar) \ + -border 3 -padding 0 -sticky ns + + # Small Progressbar + ttk::style layout Small.Horizontal.TProgressbar { + Small.Horizontal.Progressbar.trough -children { + Small.Horizontal.Progressbar.pbar + } + } + ttk::style layout Small.Vertical.TProgressbar { + Small.Vertical.Progressbar.trough -children { + Small.Vertical.Progressbar.pbar + } + } + + ttk::style element create Small.Horizontal.Progressbar.trough image $I(hor-trough-small) \ + -border 1 -padding 0 -sticky ew + + ttk::style element create Small.Horizontal.Progressbar.pbar image $I(hor-pbar-small) \ + -border 1 -padding 0 -sticky ew + + ttk::style element create Small.Vertical.Progressbar.trough image $I(vert-trough-small) \ + -border 1 -padding 0 -sticky ns + + ttk::style element create Small.Vertical.Progressbar.pbar image $I(vert-pbar-small) \ + -border 1 -padding 0 -sticky ns + + # Entry + ttk::style element create Entry.field \ + image [list $I(box-basic) \ + {focus hover} $I(box-accent) \ + invalid $I(box-invalid) \ + disabled $I(box-basic) \ + focus $I(box-accent) \ + hover $I(box-hover) \ + ] -border 5 -padding {8} -sticky news + + # Combobox + ttk::style map TCombobox -selectbackground [list \ + {!focus} $colors(-selectbg) \ + {readonly hover} $colors(-selectbg) \ + {readonly focus} $colors(-selectbg) \ + ] + + ttk::style map TCombobox -selectforeground [list \ + {!focus} $colors(-selectfg) \ + {readonly hover} $colors(-selectfg) \ + {readonly focus} $colors(-selectfg) \ + ] + + ttk::style element create Combobox.field \ + image [list $I(box-basic) \ + {readonly disabled} $I(rect-basic) \ + {readonly pressed} $I(rect-basic) \ + {readonly focus hover} $I(button-hover) \ + {readonly focus} $I(button-hover) \ + {readonly hover} $I(button-hover) \ + {focus hover} $I(box-accent) \ + readonly $I(rect-basic) \ + invalid $I(box-invalid) \ + disabled $I(box-basic) \ + focus $I(box-accent) \ + hover $I(box-hover) \ + ] -border 5 -padding {8} + + ttk::style element create Combobox.button \ + image [list $I(combo-button-basic) \ + {!readonly focus} $I(combo-button-focus) \ + {readonly focus} $I(combo-button-hover) \ + {readonly hover} $I(combo-button-hover) + ] -border 5 -padding {2 6 6 6} + + ttk::style element create Combobox.arrow image $I(down) \ + -width 15 -sticky e + + # Spinbox + ttk::style element create Spinbox.field \ + image [list $I(box-basic) \ + invalid $I(box-invalid) \ + disabled $I(box-basic) \ + focus $I(box-accent) \ + hover $I(box-hover) \ + ] -border 5 -padding {8} -sticky news + + ttk::style element create Spinbox.uparrow \ + image [list $I(up) \ + disabled $I(up) \ + pressed $I(up-accent) \ + active $I(up-accent) \ + ] -border 4 -width 15 -sticky e + + ttk::style element create Spinbox.downarrow \ + image [list $I(down) \ + disabled $I(down) \ + pressed $I(down-accent) \ + active $I(down-accent) \ + ] -border 4 -width 15 -sticky e + + ttk::style element create Spinbox.button \ + image [list $I(combo-button-basic) \ + {!readonly focus} $I(combo-button-focus) \ + {readonly focus} $I(combo-button-hover) \ + {readonly hover} $I(combo-button-hover) + ] -border 5 -padding {2 6 6 6} + + # Sizegrip + ttk::style element create Sizegrip.sizegrip image $I(size) \ + -sticky ewns + + # Separator + ttk::style element create Horizontal.separator image $I(separator) + + ttk::style element create Vertical.separator image $I(separator) + + # Card + ttk::style element create Card.field image $I(card) \ + -border 10 -padding 4 -sticky news + + # Labelframe + ttk::style element create Labelframe.border image $I(card) \ + -border 5 -padding 4 -sticky news + + # Notebook + ttk::style element create Notebook.client \ + image $I(notebook) -border 5 + + ttk::style element create Notebook.tab \ + image [list $I(tab-disabled) \ + selected $I(tab-basic) \ + active $I(tab-hover) \ + ] -border 5 -padding {14 4} + + # Treeview + ttk::style element create Treeview.field image $I(card) \ + -border 5 + + ttk::style element create Treeheading.cell \ + image [list $I(tree-basic) \ + pressed $I(tree-pressed) + ] -border 5 -padding 4 -sticky ewns + + ttk::style element create Treeitem.indicator \ + image [list $I(right) \ + user2 $I(empty) \ + user1 $I(down) \ + ] -width 26 -sticky {} + + ttk::style configure Treeview -background $colors(-bg) + ttk::style configure Treeview.Item -padding {2 0 0 0} + ttk::style map Treeview \ + -background [list selected $colors(-selectbg)] \ + -foreground [list selected $colors(-selectfg)] + + ttk::style configure TEntry -foreground $colors(-fg) -fieldbackground $colors(-bg) + ttk::style map TLabelframe -foreground [list disabled $colors(-disabledfg)] + ttk::style map TLabel -foreground [list disabled $colors(-disabledfg)] + ttk::style map TButton -foreground [list disabled $colors(-disabledfg)] + ttk::style map TCheckbutton -foreground [list disabled $colors(-disabledfg)] + ttk::style map TRadiobutton -foreground [list disabled $colors(-disabledfg)] + ttk::style map TEntry -foreground [list disabled $colors(-disabledfg)] -fieldbackground [list disabled $colors(-disabledbg) readonly $colors(-disabledbg)] + + # Panedwindow + # Insane hack to remove clam's ugly sash + ttk::style configure Sash -gripcount 0 + ttk::style configure TPanedwindow -padding 0 + } +} diff --git a/TK-Themes/theme/dark/button-borderless-hover.png b/TK-Themes/theme/dark/button-borderless-hover.png new file mode 100644 index 0000000..c23f237 Binary files /dev/null and b/TK-Themes/theme/dark/button-borderless-hover.png differ diff --git a/TK-Themes/theme/dark/button-hover.png b/TK-Themes/theme/dark/button-hover.png index 300eb09..6a26c54 100644 Binary files a/TK-Themes/theme/dark/button-hover.png and b/TK-Themes/theme/dark/button-hover.png differ diff --git a/TK-Themes/theme/dark/combo-button-basic.png b/TK-Themes/theme/dark/combo-button-basic.png index 4aef1b2..db56892 100644 Binary files a/TK-Themes/theme/dark/combo-button-basic.png and b/TK-Themes/theme/dark/combo-button-basic.png differ diff --git a/TK-Themes/theme/dark/combo-button-focus.png b/TK-Themes/theme/dark/combo-button-focus.png index e37db17..5df1b68 100644 Binary files a/TK-Themes/theme/dark/combo-button-focus.png and b/TK-Themes/theme/dark/combo-button-focus.png differ diff --git a/TK-Themes/theme/dark/combo-button-hover.png b/TK-Themes/theme/dark/combo-button-hover.png index 493cf52..8a8d0be 100644 Binary files a/TK-Themes/theme/dark/combo-button-hover.png and b/TK-Themes/theme/dark/combo-button-hover.png differ diff --git a/TK-Themes/theme/dark/hor-pbar-small.png b/TK-Themes/theme/dark/hor-pbar-small.png new file mode 100644 index 0000000..d47a673 Binary files /dev/null and b/TK-Themes/theme/dark/hor-pbar-small.png differ diff --git a/TK-Themes/theme/dark/hor-pbar.png b/TK-Themes/theme/dark/hor-pbar.png new file mode 100644 index 0000000..3755518 Binary files /dev/null and b/TK-Themes/theme/dark/hor-pbar.png differ diff --git a/TK-Themes/theme/dark/hor-trough-small.png b/TK-Themes/theme/dark/hor-trough-small.png new file mode 100644 index 0000000..96e37b4 Binary files /dev/null and b/TK-Themes/theme/dark/hor-trough-small.png differ diff --git a/TK-Themes/theme/dark/hor-trough.png b/TK-Themes/theme/dark/hor-trough.png new file mode 100644 index 0000000..e0192e2 Binary files /dev/null and b/TK-Themes/theme/dark/hor-trough.png differ diff --git a/TK-Themes/theme/dark/rect-basic.png b/TK-Themes/theme/dark/rect-basic.png index 8ab4d10..461f507 100644 Binary files a/TK-Themes/theme/dark/rect-basic.png and b/TK-Themes/theme/dark/rect-basic.png differ diff --git a/TK-Themes/theme/dark/vert-pbar-small.png b/TK-Themes/theme/dark/vert-pbar-small.png new file mode 100644 index 0000000..62d8603 Binary files /dev/null and b/TK-Themes/theme/dark/vert-pbar-small.png differ diff --git a/TK-Themes/theme/dark/vert-pbar.png b/TK-Themes/theme/dark/vert-pbar.png new file mode 100644 index 0000000..ee6f929 Binary files /dev/null and b/TK-Themes/theme/dark/vert-pbar.png differ diff --git a/TK-Themes/theme/dark/vert-trough-small.png b/TK-Themes/theme/dark/vert-trough-small.png new file mode 100644 index 0000000..12c4da6 Binary files /dev/null and b/TK-Themes/theme/dark/vert-trough-small.png differ diff --git a/TK-Themes/theme/dark/vert-trough.png b/TK-Themes/theme/dark/vert-trough.png new file mode 100644 index 0000000..7c98196 Binary files /dev/null and b/TK-Themes/theme/dark/vert-trough.png differ diff --git a/TK-Themes/theme/light.tcl b/TK-Themes/theme/light.tcl index dbd6dad..2e7b8bb 100644 --- a/TK-Themes/theme/light.tcl +++ b/TK-Themes/theme/light.tcl @@ -1,539 +1,623 @@ -# Copyright (c) 2021 rdbende - -# inspired by rdbende modified azure to water by Désire Werner Menrath polunga40@unity-mail.de 2024 - -package require Tk 8.6 - -namespace eval ttk::theme::water-light { - variable version 2.0 - package provide ttk::theme::water-light $version - - ttk::style theme create water-light -parent clam -settings { - proc load_images {imgdir} { - variable I - foreach file [glob -directory $imgdir *.png] { - set img [file tail [file rootname $file]] - set I($img) [image create photo -file $file -format png] - } - } - - load_images [file join [file dirname [info script]] light] - - array set colors { - -fg "#000000" - -bg "#ffffff" - -disabledfg "#737373" - -disabledbg "#ffffff" - -selectfg "#ffffff" - -selectbg "#007fff" - } - - ttk::style layout TButton { - Button.button -children { - Button.padding -children { - Button.label -side left -expand true - } - } - } - - ttk::style layout Toolbutton { - Toolbutton.button -children { - Toolbutton.padding -children { - Toolbutton.label -side left -expand true - } - } - } - - ttk::style layout TMenubutton { - Menubutton.button -children { - Menubutton.padding -children { - Menubutton.indicator -side right - Menubutton.label -side right -expand true - } - } - } - - ttk::style layout TOptionMenu { - OptionMenu.button -children { - OptionMenu.padding -children { - OptionMenu.indicator -side right - OptionMenu.label -side right -expand true - } - } - } - - ttk::style layout Accent.TButton { - AccentButton.button -children { - AccentButton.padding -children { - AccentButton.label -side left -expand true - } - } - } - - ttk::style layout TCheckbutton { - Checkbutton.button -children { - Checkbutton.padding -children { - Checkbutton.indicator -side left - Checkbutton.label -side right -expand true - } - } - } - - ttk::style layout Switch.TCheckbutton { - Switch.button -children { - Switch.padding -children { - Switch.indicator -side left - Switch.label -side right -expand true - } - } - } - - ttk::style layout Toggle.TButton { - ToggleButton.button -children { - ToggleButton.padding -children { - ToggleButton.label -side left -expand true - } - } - } - - ttk::style layout TRadiobutton { - Radiobutton.button -children { - Radiobutton.padding -children { - Radiobutton.indicator -side left - Radiobutton.label -side right -expand true - } - } - } - - ttk::style layout Vertical.TScrollbar { - Vertical.Scrollbar.trough -sticky ns -children { - Vertical.Scrollbar.thumb -expand true - } - } - - ttk::style layout Horizontal.TScrollbar { - Horizontal.Scrollbar.trough -sticky ew -children { - Horizontal.Scrollbar.thumb -expand true - } - } - - ttk::style layout TCombobox { - Combobox.field -sticky nswe -children { - Combobox.padding -expand true -sticky nswe -children { - Combobox.textarea -sticky nswe - } - } - Combobox.button -side right -sticky ns -children { - Combobox.arrow -sticky nsew - } - } - - ttk::style layout TSpinbox { - Spinbox.field -sticky nsew -children { - Spinbox.padding -expand true -sticky nswe -children { - Spinbox.textarea -sticky nswe - } - - } - Spinbox.button -side right -sticky ns -children { - null -side right -children { - Spinbox.uparrow -side top - Spinbox.downarrow -side bottom - } - } - } - - ttk::style layout Horizontal.TSeparator { - Horizontal.separator -sticky nswe - } - - ttk::style layout Vertical.TSeparator { - Vertical.separator -sticky nswe - } - - ttk::style layout Horizontal.Tick.TScale { - Horizontal.TickScale.trough -sticky ew -children { - Horizontal.TickScale.slider -sticky w - } - } - - ttk::style layout Vertical.Tick.TScale { - Vertical.TickScale.trough -sticky ns -children { - Vertical.TickScale.slider -sticky n - } - } - - ttk::style layout Card.TFrame { - Card.field { - Card.padding -expand 1 - } - } - - ttk::style layout TLabelframe { - Labelframe.border { - Labelframe.padding -expand 1 -children { - Labelframe.label -side right - } - } - } - - ttk::style layout TNotebook.Tab { - Notebook.tab -children { - Notebook.padding -side top -children { - Notebook.label -side top -sticky {} - } - } - } - - ttk::style layout Treeview.Item { - Treeitem.padding -sticky nswe -children { - Treeitem.indicator -side left -sticky {} - Treeitem.image -side left -sticky {} - Treeitem.text -side left -sticky {} - } - } - - - # Elements - - # Button - ttk::style configure TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create Button.button image \ - [list $I(box-basic) \ - {selected disabled} $I(box-basic) \ - disabled $I(box-basic) \ - selected $I(box-basic) \ - pressed $I(box-basic) \ - active $I(button-hover) \ - focus $I(button-hover) \ - ] -border 4 -sticky ewns - - # Toolbutton - ttk::style configure Toolbutton -padding {8 4 8 4} -width -5 -anchor center - - ttk::style element create Toolbutton.button image \ - [list $I(empty) \ - {selected disabled} $I(empty) \ - disabled $I(empty) \ - selected $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(rect-basic) \ - ] -border 4 -sticky ewns - - # Menubutton - ttk::style configure TMenubutton -padding {8 4 4 4} - - ttk::style element create Menubutton.button \ - image [list $I(rect-basic) \ - disabled $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(button-hover) \ - ] -border 4 -sticky ewns - - ttk::style element create Menubutton.indicator \ - image [list $I(down) \ - active $I(down) \ - pressed $I(down) \ - disabled $I(down) \ - ] -width 15 -sticky e - - # OptionMenu - ttk::style configure TOptionMenu -padding {8 4 4 4} - - ttk::style element create OptionMenu.button \ - image [list $I(rect-basic) \ - disabled $I(rect-basic) \ - pressed $I(rect-basic) \ - active $I(button-hover) \ - ] -border 4 -sticky ewns - - ttk::style element create OptionMenu.indicator \ - image [list $I(down) \ - active $I(down) \ - pressed $I(down) \ - disabled $I(down) \ - ] -width 15 -sticky e - - # AccentButton - ttk::style configure Accent.TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create AccentButton.button image \ - [list $I(rect-accent) \ - {selected disabled} $I(rect-accent-hover) \ - disabled $I(rect-accent-hover) \ - selected $I(rect-accent) \ - pressed $I(rect-accent) \ - active $I(rect-accent-hover) \ - focus $I(rect-accent-hover) \ - ] -border 4 -sticky ewns - - # Checkbutton - ttk::style configure TCheckbutton -padding 4 - - ttk::style element create Checkbutton.indicator image \ - [list $I(box-basic) \ - {alternate disabled} $I(check-tri-basic) \ - {selected disabled} $I(check-basic) \ - disabled $I(box-basic) \ - {pressed alternate} $I(check-tri-hover) \ - {active alternate} $I(check-tri-hover) \ - alternate $I(check-tri-accent) \ - {pressed selected} $I(check-hover) \ - {active selected} $I(check-hover) \ - selected $I(check-accent) \ - {pressed !selected} $I(rect-hover) \ - active $I(box-hover) \ - ] -width 26 -sticky w - - # Switch - ttk::style element create Switch.indicator image \ - [list $I(off-basic) \ - {selected disabled} $I(on-basic) \ - disabled $I(off-basic) \ - {pressed selected} $I(on-hover) \ - {active selected} $I(on-hover) \ - selected $I(on-accent) \ - {pressed !selected} $I(off-hover) \ - active $I(off-hover) \ - ] -width 46 -sticky w - - # ToggleButton - ttk::style configure Toggle.TButton -padding {8 4 8 4} -width -10 -anchor center - - ttk::style element create ToggleButton.button image \ - [list $I(rect-basic) \ - {selected disabled} $I(rect-accent-hover) \ - disabled $I(rect-basic) \ - {pressed selected} $I(rect-basic) \ - {active selected} $I(rect-accent) \ - selected $I(rect-accent) \ - {pressed !selected} $I(rect-accent) \ - active $I(rect-basic) \ - ] -border 4 -sticky ewns - - # Radiobutton - ttk::style configure TRadiobutton -padding 4 - - ttk::style element create Radiobutton.indicator image \ - [list $I(outline-basic) \ - {alternate disabled} $I(radio-tri-basic) \ - {selected disabled} $I(radio-basic) \ - disabled $I(outline-basic) \ - {pressed alternate} $I(radio-tri-hover) \ - {active alternate} $I(radio-tri-hover) \ - alternate $I(radio-tri-accent) \ - {pressed selected} $I(radio-hover) \ - {active selected} $I(radio-hover) \ - selected $I(radio-accent) \ - {pressed !selected} $I(circle-hover) \ - active $I(outline-hover) \ - ] -width 26 -sticky w - - # Scrollbar - ttk::style element create Horizontal.Scrollbar.trough image $I(hor-basic) \ - -sticky ew - - ttk::style element create Horizontal.Scrollbar.thumb \ - image [list $I(hor-accent) \ - disabled $I(hor-basic) \ - pressed $I(hor-hover) \ - active $I(hor-hover) \ - ] -sticky ew - - ttk::style element create Vertical.Scrollbar.trough image $I(vert-basic) \ - -sticky ns - - ttk::style element create Vertical.Scrollbar.thumb \ - image [list $I(vert-accent) \ - disabled $I(vert-basic) \ - pressed $I(vert-hover) \ - active $I(vert-hover) \ - ] -sticky ns - - # Scale - ttk::style element create Horizontal.Scale.trough image $I(scale-hor) \ - -border 5 -padding 0 - - ttk::style element create Horizontal.Scale.slider \ - image [list $I(circle-accent) \ - disabled $I(circle-basic) \ - pressed $I(circle-hover) \ - active $I(circle-hover) \ - ] -sticky {} - - ttk::style element create Vertical.Scale.trough image $I(scale-vert) \ - -border 5 -padding 0 - - ttk::style element create Vertical.Scale.slider \ - image [list $I(circle-accent) \ - disabled $I(circle-basic) \ - pressed $I(circle-hover) \ - active $I(circle-hover) \ - ] -sticky {} - - # Tickscale - ttk::style element create Horizontal.TickScale.trough image $I(scale-hor) \ - -border 5 -padding 0 - - ttk::style element create Horizontal.TickScale.slider \ - image [list $I(tick-hor-accent) \ - disabled $I(tick-hor-basic) \ - pressed $I(tick-hor-hover) \ - active $I(tick-hor-hover) \ - ] -sticky {} - - ttk::style element create Vertical.TickScale.trough image $I(scale-vert) \ - -border 5 -padding 0 - - ttk::style element create Vertical.TickScale.slider \ - image [list $I(tick-vert-accent) \ - disabled $I(tick-vert-basic) \ - pressed $I(tick-vert-hover) \ - active $I(tick-vert-hover) \ - ] -sticky {} - - # Progressbar - ttk::style element create Horizontal.Progressbar.trough image $I(hor-basic) \ - -sticky ew - - ttk::style element create Horizontal.Progressbar.pbar image $I(hor-accent) \ - -sticky ew - - ttk::style element create Vertical.Progressbar.trough image $I(vert-basic) \ - -sticky ns - - ttk::style element create Vertical.Progressbar.pbar image $I(vert-accent) \ - -sticky ns - - # Entry - ttk::style element create Entry.field \ - image [list $I(box-basic) \ - {focus hover} $I(box-accent) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} -sticky news - - # Combobox - ttk::style map TCombobox -selectbackground [list \ - {!focus} $colors(-selectbg) \ - {readonly hover} $colors(-selectbg) \ - {readonly focus} $colors(-selectbg) \ - ] - - ttk::style map TCombobox -selectforeground [list \ - {!focus} $colors(-selectfg) \ - {readonly hover} $colors(-selectfg) \ - {readonly focus} $colors(-selectfg) \ - ] - - ttk::style element create Combobox.field \ - image [list $I(box-basic) \ - {readonly disabled} $I(rect-basic) \ - {readonly pressed} $I(rect-basic) \ - {readonly focus hover} $I(button-hover) \ - {readonly focus} $I(button-hover) \ - {readonly hover} $I(button-hover) \ - {focus hover} $I(box-accent) \ - readonly $I(rect-basic) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} - - ttk::style element create Combobox.button \ - image [list $I(combo-button-basic) \ - {!readonly focus} $I(combo-button-focus) \ - {readonly focus} $I(combo-button-hover) \ - {readonly hover} $I(combo-button-hover) - ] -border 5 -padding {2 6 6 6} - - ttk::style element create Combobox.arrow image $I(down) \ - -width 15 -sticky e - - # Spinbox - ttk::style element create Spinbox.field \ - image [list $I(box-basic) \ - invalid $I(box-invalid) \ - disabled $I(box-basic) \ - focus $I(box-accent) \ - hover $I(box-hover) \ - ] -border 5 -padding {8} -sticky news - - ttk::style element create Spinbox.uparrow \ - image [list $I(up) \ - disabled $I(up) \ - pressed $I(up-accent) \ - active $I(up-accent) \ - ] -border 4 -width 15 -sticky e - - ttk::style element create Spinbox.downarrow \ - image [list $I(down) \ - disabled $I(down) \ - pressed $I(down-accent) \ - active $I(down-accent) \ - ] -border 4 -width 15 -sticky e - - ttk::style element create Spinbox.button \ - image [list $I(combo-button-basic) \ - {!readonly focus} $I(combo-button-focus) \ - {readonly focus} $I(combo-button-hover) \ - {readonly hover} $I(combo-button-hover) - ] -border 5 -padding {2 6 6 6} - - # Sizegrip - ttk::style element create Sizegrip.sizegrip image $I(size) \ - -sticky ewns - - # Separator - ttk::style element create Horizontal.separator image $I(separator) - - ttk::style element create Vertical.separator image $I(separator) - - # Card - ttk::style element create Card.field image $I(card) \ - -border 10 -padding 4 -sticky news - - # Labelframe - ttk::style element create Labelframe.border image $I(card) \ - -border 5 -padding 4 -sticky news - - # Notebook - ttk::style element create Notebook.client \ - image $I(notebook) -border 5 - - ttk::style element create Notebook.tab \ - image [list $I(tab-disabled) \ - selected $I(tab-basic) \ - active $I(tab-hover) \ - ] -border 5 -padding {14 4} - - # Treeview - ttk::style element create Treeview.field image $I(card) \ - -border 5 - - ttk::style element create Treeheading.cell \ - image [list $I(tree-basic) \ - pressed $I(tree-pressed) - ] -border 5 -padding 4 -sticky ewns - - ttk::style element create Treeitem.indicator \ - image [list $I(right) \ - user2 $I(empty) \ - user1 $I(down) \ - ] -width 26 -sticky {} - - ttk::style configure Treeview -background $colors(-bg) - ttk::style configure Treeview.Item -padding {2 0 0 0} - ttk::style map Treeview \ - -background [list selected #ccc] \ - -foreground [list selected $colors(-fg)] - - # Panedwindow - # Insane hack to remove clam's ugly sash - ttk::style configure Sash -gripcount 0 - } -} +# Copyright (c) 2021 rdbende + +# inspired by rdbende modified azure to water by Désire Werner Menrath polunga40@unity-mail.de 2024 +# Update add New Style TButton.Borderless for Buttons without edge and without rounded corners by +# Désire Werner Menrath 28-07-2025 +# Add Update Progressbars Round ends on Horizontal and Vertikal + add small bars +# Désire Werner Menrath 30-07-2025 + +package require Tk 8.6 + +namespace eval ttk::theme::water-light { + variable version 2.0 + package provide ttk::theme::water-light $version + + ttk::style theme create water-light -parent clam -settings { + proc load_images {imgdir} { + variable I + foreach file [glob -directory $imgdir *.png] { + set img [file tail [file rootname $file]] + set I($img) [image create photo -file $file -format png] + } + } + + load_images [file join [file dirname [info script]] light] + + array set colors { + -fg "#000000" + -bg "#ffffff" + -disabledfg "#737373" + -disabledbg "#f0f0f0" + -selectfg "#ffffff" + -selectbg "#007fff" + } + + ttk::style layout TButton { + Button.button -children { + Button.padding -children { + Button.label -side left -expand true + } + } + } + + ttk::style layout Toolbutton { + Toolbutton.button -children { + Toolbutton.padding -children { + Toolbutton.label -side left -expand true + } + } + } + + + ttk::style layout TMenubutton { + Menubutton.button -children { + Menubutton.padding -children { + Menubutton.indicator -side right + Menubutton.label -side right -expand true + } + } + } + + ttk::style layout TOptionMenu { + OptionMenu.button -children { + OptionMenu.padding -children { + OptionMenu.indicator -side right + OptionMenu.label -side right -expand true + } + } + } + + ttk::style layout Accent.TButton { + AccentButton.button -children { + AccentButton.padding -children { + AccentButton.label -side left -expand true + } + } + } + + ttk::style layout TCheckbutton { + Checkbutton.button -children { + Checkbutton.padding -children { + Checkbutton.indicator -side left + Checkbutton.label -side right -expand true + } + } + } + + ttk::style layout Switch.TCheckbutton { + Switch.button -children { + Switch.padding -children { + Switch.indicator -side left + Switch.label -side right -expand true + } + } + } + + ttk::style layout Toggle.TButton { + ToggleButton.button -children { + ToggleButton.padding -children { + ToggleButton.label -side left -expand true + } + } + } + + ttk::style layout TRadiobutton { + Radiobutton.button -children { + Radiobutton.padding -children { + Radiobutton.indicator -side left + Radiobutton.label -side right -expand true + } + } + } + + ttk::style layout Vertical.TScrollbar { + Vertical.Scrollbar.trough -sticky ns -children { + Vertical.Scrollbar.thumb -expand true + } + } + + ttk::style layout Horizontal.TScrollbar { + Horizontal.Scrollbar.trough -sticky ew -children { + Horizontal.Scrollbar.thumb -expand true + } + } + + ttk::style layout TEntry { + Combobox.field -sticky nswe -children { + Combobox.padding -expand true -sticky nswe -children { + Combobox.textarea -sticky nswe + } + } + } + + ttk::style layout TCombobox { + Combobox.field -sticky nswe -children { + Combobox.padding -expand true -sticky nswe -children { + Combobox.textarea -sticky nswe + } + } + Combobox.button -side right -sticky ns -children { + Combobox.arrow -sticky nsew + } + } + + ttk::style layout TSpinbox { + Spinbox.field -sticky nsew -children { + Spinbox.padding -expand true -sticky nswe -children { + Spinbox.textarea -sticky nswe + } + + } + Spinbox.button -side right -sticky ns -children { + null -side right -children { + Spinbox.uparrow -side top + Spinbox.downarrow -side bottom + } + } + } + + ttk::style layout Horizontal.TSeparator { + Horizontal.separator -sticky nswe + } + + ttk::style layout Vertical.TSeparator { + Vertical.separator -sticky nswe + } + + ttk::style layout Horizontal.Tick.TScale { + Horizontal.TickScale.trough -sticky ew -children { + Horizontal.TickScale.slider -sticky w + } + } + + ttk::style layout Vertical.Tick.TScale { + Vertical.TickScale.trough -sticky ns -children { + Vertical.TickScale.slider -sticky n + } + } + + ttk::style layout Card.TFrame { + Card.field { + Card.padding -expand 1 + } + } + + ttk::style layout TLabelframe { + Labelframe.border { + Labelframe.padding -expand 1 -children { + Labelframe.label -side right + } + } + } + + ttk::style layout TNotebook.Tab { + Notebook.tab -children { + Notebook.padding -side top -children { + Notebook.label -side top -sticky {} + } + } + } + + ttk::style layout Treeview.Item { + Treeitem.padding -sticky nswe -children { + Treeitem.indicator -side left -sticky {} + Treeitem.image -side left -sticky {} + Treeitem.text -side left -sticky {} + } + } + + + # Elements + + # Button + ttk::style configure TButton -padding {8 4 8 4} -width -10 -anchor center + + ttk::style element create Button.button image [list $I(box-basic) {selected disabled} $I(box-basic) disabled $I(box-basic) selected $I(box-basic) pressed $I(box-basic) active $I(button-hover) focus $I(box-basic) ] -border 4 -sticky ewns + + # Borderless Button + ttk::style configure TButton.Borderless -padding 0 -width -10 -anchor center + ttk::style element create BorderlessButton.button image \ + [list $I(empty) \ + active $I(button-borderless-hover) \ + pressed $I(button-borderless-hover) \ + focus $I(button-borderless-hover) \ + ] -border 0 -sticky ewns + ttk::style layout TButton.Borderless { + BorderlessButton.button -children { + Button.padding -children { + Button.label -side left -expand true + } + } + } + + # Toolbutton + ttk::style configure Toolbutton -padding {8 4 8 4} -width -5 -anchor center + + ttk::style element create Toolbutton.button image \ + [list $I(empty) \ + {selected disabled} $I(empty) \ + disabled $I(empty) \ + selected $I(rect-basic) \ + pressed $I(rect-basic) \ + active $I(rect-basic) \ + ] -border 4 -sticky ewns + + # TButton Borderless Round + ttk::style configure TButton.Borderless.Round -padding 0 -width -10 -anchor center + ttk::style element create TButton.Borderless.Round.button image \ + [list $I(empty) \ + {selected disabled} $I(empty) \ + disabled $I(empty) \ + selected $I(rect-basic) \ + pressed $I(rect-basic) \ + active $I(rect-basic) \ + ] -border 4 -sticky ewns + ttk::style layout TButton.Borderless.Round { + TButton.Borderless.Round.button -children { + Button.padding -children { + Button.label -side left -expand true + } + } + } + + + # Menubutton + ttk::style configure TMenubutton -padding {8 4 4 4} + + ttk::style element create Menubutton.button \ + image [list $I(rect-basic) \ + disabled $I(rect-basic) \ + pressed $I(rect-basic) \ + active $I(button-hover) \ + ] -border 4 -sticky ewns + + ttk::style element create Menubutton.indicator \ + image [list $I(down) \ + active $I(down) \ + pressed $I(down) \ + disabled $I(down) \ + ] -width 15 -sticky e + + # OptionMenu + ttk::style configure TOptionMenu -padding {8 4 4 4} + + ttk::style element create OptionMenu.button \ + image [list $I(rect-basic) \ + disabled $I(rect-basic) \ + pressed $I(rect-basic) \ + active $I(button-hover) \ + ] -border 4 -sticky ewns + + ttk::style element create OptionMenu.indicator \ + image [list $I(down) \ + active $I(down) \ + pressed $I(down) \ + disabled $I(down) \ + ] -width 15 -sticky e + + # AccentButton + ttk::style configure Accent.TButton -padding {8 4 8 4} -width -10 -anchor center + + ttk::style element create AccentButton.button image \ + [list $I(rect-accent) \ + {selected disabled} $I(rect-accent-hover) \ + disabled $I(rect-accent-hover) \ + selected $I(rect-accent) \ + pressed $I(rect-accent) \ + active $I(rect-accent-hover) \ + focus $I(rect-accent) \ + ] -border 4 -sticky ewns + + # Checkbutton + ttk::style configure TCheckbutton -padding 4 + + ttk::style element create Checkbutton.indicator image \ + [list $I(box-basic) \ + {alternate disabled} $I(check-tri-basic) \ + {selected disabled} $I(check-basic) \ + disabled $I(box-basic) \ + {pressed alternate} $I(check-tri-hover) \ + {active alternate} $I(check-tri-hover) \ + alternate $I(check-tri-accent) \ + {pressed selected} $I(check-hover) \ + {active selected} $I(check-hover) \ + selected $I(check-accent) \ + {pressed !selected} $I(rect-hover) \ + active $I(box-hover) \ + ] -width 26 -sticky w + + # Switch + ttk::style element create Switch.indicator image \ + [list $I(off-basic) \ + {selected disabled} $I(on-basic) \ + disabled $I(off-basic) \ + {pressed selected} $I(on-hover) \ + {active selected} $I(on-hover) \ + selected $I(on-accent) \ + {pressed !selected} $I(off-hover) \ + active $I(off-hover) \ + ] -width 46 -sticky w + + # ToggleButton + ttk::style configure Toggle.TButton -padding {8 4 8 4} -width -10 -anchor center + + ttk::style element create ToggleButton.button image \ + [list $I(rect-basic) \ + {selected disabled} $I(rect-accent-hover) \ + disabled $I(rect-basic) \ + {pressed selected} $I(rect-basic) \ + {active selected} $I(rect-accent) \ + selected $I(rect-accent) \ + {pressed !selected} $I(rect-accent) \ + active $I(rect-basic) \ + ] -border 4 -sticky ewns + + # Radiobutton + ttk::style configure TRadiobutton -padding 4 + + ttk::style element create Radiobutton.indicator image \ + [list $I(outline-basic) \ + {alternate disabled} $I(radio-tri-basic) \ + {selected disabled} $I(radio-basic) \ + disabled $I(outline-basic) \ + {pressed alternate} $I(radio-tri-hover) \ + {active alternate} $I(radio-tri-hover) \ + alternate $I(radio-tri-accent) \ + {pressed selected} $I(radio-hover) \ + {active selected} $I(radio-hover) \ + selected $I(radio-accent) \ + {pressed !selected} $I(circle-hover) \ + active $I(outline-hover) \ + ] -width 26 -sticky w + + # Scrollbar + ttk::style element create Horizontal.Scrollbar.trough image $I(hor-basic) \ + -sticky ew + + ttk::style element create Horizontal.Scrollbar.thumb \ + image [list $I(hor-accent) \ + disabled $I(hor-basic) \ + pressed $I(hor-hover) \ + active $I(hor-hover) \ + ] -sticky ew + + ttk::style element create Vertical.Scrollbar.trough image $I(vert-basic) \ + -sticky ns + + ttk::style element create Vertical.Scrollbar.thumb \ + image [list $I(vert-accent) \ + disabled $I(vert-basic) \ + pressed $I(vert-hover) \ + active $I(vert-hover) \ + ] -sticky ns + + # Scale + ttk::style element create Horizontal.Scale.trough image $I(scale-hor) \ + -border 5 -padding 0 + + ttk::style element create Horizontal.Scale.slider \ + image [list $I(circle-accent) \ + disabled $I(circle-basic) \ + pressed $I(circle-hover) \ + active $I(circle-hover) \ + ] -sticky {} + + ttk::style element create Vertical.Scale.trough image $I(scale-vert) \ + -border 5 -padding 0 + + ttk::style element create Vertical.Scale.slider \ + image [list $I(circle-accent) \ + disabled $I(circle-basic) \ + pressed $I(circle-hover) \ + active $I(circle-hover) \ + ] -sticky {} + + # Tickscale + ttk::style element create Horizontal.TickScale.trough image $I(scale-hor) \ + -border 5 -padding 0 + + ttk::style element create Horizontal.TickScale.slider \ + image [list $I(tick-hor-accent) \ + disabled $I(tick-hor-basic) \ + pressed $I(tick-hor-hover) \ + active $I(tick-hor-hover) \ + ] -sticky {} + + ttk::style element create Vertical.TickScale.trough image $I(scale-vert) \ + -border 5 -padding 0 + + ttk::style element create Vertical.TickScale.slider \ + image [list $I(tick-vert-accent) \ + disabled $I(tick-vert-basic) \ + pressed $I(tick-vert-hover) \ + active $I(tick-vert-hover) \ + ] -sticky {} + + # Progressbar + ttk::style layout Horizontal.TProgressbar { + Horizontal.Progressbar.trough -children { + Horizontal.Progressbar.pbar + } + } + ttk::style layout Vertical.TProgressbar { + Vertical.Progressbar.trough -children { + Vertical.Progressbar.pbar + } + } + + ttk::style element create Horizontal.Progressbar.trough image $I(hor-trough) \ + -border 3 -padding 0 -sticky ew + + ttk::style element create Horizontal.Progressbar.pbar image $I(hor-pbar) \ + -border 3 -padding 0 -sticky ew + + ttk::style element create Vertical.Progressbar.trough image $I(vert-trough) \ + -border 3 -padding 0 -sticky ns + + ttk::style element create Vertical.Progressbar.pbar image $I(vert-pbar) \ + -border 3 -padding 0 -sticky ns + + # Small Progressbar + ttk::style layout Small.Horizontal.TProgressbar { + Small.Horizontal.Progressbar.trough -children { + Small.Horizontal.Progressbar.pbar + } + } + ttk::style layout Small.Vertical.TProgressbar { + Small.Vertical.Progressbar.trough -children { + Small.Vertical.Progressbar.pbar + } + } + + ttk::style element create Small.Horizontal.Progressbar.trough image $I(hor-trough-small) \ + -border 1 -padding 0 -sticky ew + + ttk::style element create Small.Horizontal.Progressbar.pbar image $I(hor-pbar-small) \ + -border 1 -padding 0 -sticky ew + + ttk::style element create Small.Vertical.Progressbar.trough image $I(vert-trough-small) \ + -border 1 -padding 0 -sticky ns + + ttk::style element create Small.Vertical.Progressbar.pbar image $I(vert-pbar-small) \ + -border 1 -padding 0 -sticky ns + + # Entry + ttk::style element create Entry.field \ + image [list $I(box-basic) \ + {focus hover} $I(box-accent) \ + invalid $I(box-invalid) \ + disabled $I(box-basic) \ + focus $I(box-accent) \ + hover $I(box-hover) \ + ] -border 5 -padding {8} -sticky news + + # Combobox + ttk::style map TCombobox -selectbackground [list \ + {!focus} $colors(-selectbg) \ + {readonly hover} $colors(-selectbg) \ + {readonly focus} $colors(-selectbg) \ + ] + + ttk::style map TCombobox -selectforeground [list \ + {!focus} $colors(-selectfg) \ + {readonly hover} $colors(-selectfg) \ + {readonly focus} $colors(-selectfg) \ + ] + + ttk::style element create Combobox.field \ + image [list $I(box-basic) \ + {readonly disabled} $I(rect-basic) \ + {readonly pressed} $I(rect-basic) \ + {readonly focus hover} $I(button-hover) \ + {readonly focus} $I(button-hover) \ + {readonly hover} $I(button-hover) \ + {focus hover} $I(box-accent) \ + readonly $I(rect-basic) \ + invalid $I(box-invalid) \ + disabled $I(box-basic) \ + focus $I(box-accent) \ + hover $I(box-hover) \ + ] -border 5 -padding {8} + + ttk::style element create Combobox.button \ + image [list $I(combo-button-basic) \ + {!readonly focus} $I(combo-button-focus) \ + {readonly focus} $I(combo-button-hover) \ + {readonly hover} $I(combo-button-hover)\ + ] -border 5 -padding {2 6 6 6} + + ttk::style element create Combobox.arrow image $I(down) \ + -width 15 -sticky e + + # Spinbox + ttk::style element create Spinbox.field \ + image [list $I(box-basic) \ + invalid $I(box-invalid) \ + disabled $I(box-basic) \ + focus $I(box-accent) \ + hover $I(box-hover) \ + ] -border 5 -padding {8} -sticky news + + ttk::style element create Spinbox.uparrow \ + image [list $I(up) \ + disabled $I(up) \ + pressed $I(up-accent) \ + active $I(up-accent) \ + ] -border 4 -width 15 -sticky e + + ttk::style element create Spinbox.downarrow \ + image [list $I(down) \ + disabled $I(down) \ + pressed $I(down-accent) \ + active $I(down-accent) \ + ] -border 4 -width 15 -sticky e + + ttk::style element create Spinbox.button \ + image [list $I(combo-button-basic) \ + {!readonly focus} $I(combo-button-focus) \ + {readonly focus} $I(combo-button-hover) \ + {readonly hover} $I(combo-button-hover)\ + ] -border 5 -padding {2 6 6 6} + + # Sizegrip + ttk::style element create Sizegrip.sizegrip image $I(size) \ + -sticky ewns + + # Separator + ttk::style element create Horizontal.separator image $I(separator) + + ttk::style element create Vertical.separator image $I(separator) + + # Card + ttk::style element create Card.field image $I(card) \ + -border 10 -padding 4 -sticky news + + # Labelframe + ttk::style element create Labelframe.border image $I(card) \ + -border 5 -padding 4 -sticky news + + # Notebook + ttk::style element create Notebook.client \ + image $I(notebook) -border 5 + + ttk::style element create Notebook.tab \ + image [list $I(tab-disabled) \ + selected $I(tab-basic) \ + active $I(tab-hover) \ + ] -border 5 -padding {14 4} + + # Treeview + ttk::style element create Treeview.field image $I(card) \ + -border 5 + + ttk::style element create Treeheading.cell \ + image [list $I(tree-basic) \ + pressed $I(tree-pressed)\ + ] -border 5 -padding 4 -sticky ewns + + ttk::style element create Treeitem.indicator \ + image [list $I(right) \ + user2 $I(empty) \ + user1 $I(down) \ + ] -width 26 -sticky {} + + ttk::style configure Treeview -background $colors(-bg) + ttk::style configure Treeview.Item -padding {2 0 0 0} + ttk::style map Treeview \ + -background [list selected #ccc] \ + -foreground [list selected $colors(-fg)] + + ttk::style map TLabelframe -foreground [list disabled $colors(-disabledfg)] + ttk::style map TLabel -foreground [list disabled $colors(-disabledfg)] + ttk::style map TButton -foreground [list disabled $colors(-disabledfg)] + ttk::style map TCheckbutton -foreground [list disabled $colors(-disabledfg)] + ttk::style map TRadiobutton -foreground [list disabled $colors(-disabledfg)] + ttk::style map TEntry -foreground [list disabled $colors(-disabledfg)] -fieldbackground [list disabled $colors(-disabledbg) readonly $colors(-disabledbg)] + ttk::style configure TEntry -foreground $colors(-fg) -fieldbackground $colors(-bg) + + # Panedwindow + # Insane hack to remove clam's ugly sash + ttk::style configure Sash -gripcount 0 + ttk::style configure TPanedwindow -padding 0 + } +} diff --git a/TK-Themes/theme/light/button-borderless-hover.png b/TK-Themes/theme/light/button-borderless-hover.png new file mode 100644 index 0000000..d63fe1f Binary files /dev/null and b/TK-Themes/theme/light/button-borderless-hover.png differ diff --git a/TK-Themes/theme/light/button-hover.png b/TK-Themes/theme/light/button-hover.png index 13366eb..f63c599 100644 Binary files a/TK-Themes/theme/light/button-hover.png and b/TK-Themes/theme/light/button-hover.png differ diff --git a/TK-Themes/theme/light/combo-button-basic.png b/TK-Themes/theme/light/combo-button-basic.png index b7daa04..2f707f0 100644 Binary files a/TK-Themes/theme/light/combo-button-basic.png and b/TK-Themes/theme/light/combo-button-basic.png differ diff --git a/TK-Themes/theme/light/combo-button-focus.png b/TK-Themes/theme/light/combo-button-focus.png index 521aef0..f74eb88 100644 Binary files a/TK-Themes/theme/light/combo-button-focus.png and b/TK-Themes/theme/light/combo-button-focus.png differ diff --git a/TK-Themes/theme/light/combo-button-hover.png b/TK-Themes/theme/light/combo-button-hover.png index 1d06c57..07fd23d 100644 Binary files a/TK-Themes/theme/light/combo-button-hover.png and b/TK-Themes/theme/light/combo-button-hover.png differ diff --git a/TK-Themes/theme/light/hor-pbar-small.png b/TK-Themes/theme/light/hor-pbar-small.png new file mode 100644 index 0000000..719c88c Binary files /dev/null and b/TK-Themes/theme/light/hor-pbar-small.png differ diff --git a/TK-Themes/theme/light/hor-pbar.png b/TK-Themes/theme/light/hor-pbar.png new file mode 100644 index 0000000..6656697 Binary files /dev/null and b/TK-Themes/theme/light/hor-pbar.png differ diff --git a/TK-Themes/theme/light/hor-trough-small.png b/TK-Themes/theme/light/hor-trough-small.png new file mode 100644 index 0000000..96e37b4 Binary files /dev/null and b/TK-Themes/theme/light/hor-trough-small.png differ diff --git a/TK-Themes/theme/light/hor-trough.png b/TK-Themes/theme/light/hor-trough.png new file mode 100644 index 0000000..e0192e2 Binary files /dev/null and b/TK-Themes/theme/light/hor-trough.png differ diff --git a/TK-Themes/theme/light/rect-basic.png b/TK-Themes/theme/light/rect-basic.png index 239ca31..5a652a2 100644 Binary files a/TK-Themes/theme/light/rect-basic.png and b/TK-Themes/theme/light/rect-basic.png differ diff --git a/TK-Themes/theme/light/tab-hover.png b/TK-Themes/theme/light/tab-hover.png index 5003806..612ffe4 100644 Binary files a/TK-Themes/theme/light/tab-hover.png and b/TK-Themes/theme/light/tab-hover.png differ diff --git a/TK-Themes/theme/light/vert-pbar-small.png b/TK-Themes/theme/light/vert-pbar-small.png new file mode 100644 index 0000000..85e8433 Binary files /dev/null and b/TK-Themes/theme/light/vert-pbar-small.png differ diff --git a/TK-Themes/theme/light/vert-pbar.png b/TK-Themes/theme/light/vert-pbar.png new file mode 100644 index 0000000..13f7bd1 Binary files /dev/null and b/TK-Themes/theme/light/vert-pbar.png differ diff --git a/TK-Themes/theme/light/vert-trough-small.png b/TK-Themes/theme/light/vert-trough-small.png new file mode 100644 index 0000000..12c4da6 Binary files /dev/null and b/TK-Themes/theme/light/vert-trough-small.png differ diff --git a/TK-Themes/theme/light/vert-trough.png b/TK-Themes/theme/light/vert-trough.png new file mode 100644 index 0000000..7c98196 Binary files /dev/null and b/TK-Themes/theme/light/vert-trough.png differ diff --git a/TK-Themes/water.tcl b/TK-Themes/water.tcl index ac96081..d5976ef 100755 --- a/TK-Themes/water.tcl +++ b/TK-Themes/water.tcl @@ -1,5 +1,10 @@ # Copyright © 2021 rdbende # inspired by rdbende modified azure to water by Désire Werner Menrath polunga40@unity-mail.de 2024 +# Update add New Style TButton.Borderless for Buttons without edge and without rounded corners by +# Désire Werner Menrath 28-07-2025 +# Add Update Progressbars Round ends on Horizontal and Vertikal + add small bars +# Désire Werner Menrath 30-07-2025 + source [file join [file dirname [info script]] theme light.tcl] source [file join [file dirname [info script]] theme dark.tcl] @@ -13,7 +18,7 @@ proc set_theme {mode} { array set colors { -fg "#ffffff" -bg "#333333" - -disabledfg "#ffffff" + -disabledfg "#aaaaaa" -disabledbg "#737373" -selectfg "#000000" -selectbg "#00c4ff" @@ -53,7 +58,7 @@ proc set_theme {mode} { -fg "#000000" -bg "#ffffff" -disabledfg "#737373" - -disabledbg "#ffffff" + -disabledbg "#f0f0f0" -selectfg "#000000" -selectbg "#00c4ff" } diff --git a/lx-icons/128/settings-2.png b/lx-icons/128/settings-2.png new file mode 100644 index 0000000..0b0a09e Binary files /dev/null and b/lx-icons/128/settings-2.png differ diff --git a/lx-icons/128/settings.png b/lx-icons/128/settings.png new file mode 100644 index 0000000..72abb7b Binary files /dev/null and b/lx-icons/128/settings.png differ diff --git a/lx-icons/16/settings.png b/lx-icons/16/settings.png index 8f49da2..e5f4bfc 100644 Binary files a/lx-icons/16/settings.png and b/lx-icons/16/settings.png differ diff --git a/lx-icons/16/wg_vpn.png b/lx-icons/16/wg_vpn.png deleted file mode 100644 index 0bef818..0000000 Binary files a/lx-icons/16/wg_vpn.png and /dev/null differ diff --git a/lx-icons/256/settings-2.png b/lx-icons/256/settings-2.png new file mode 100644 index 0000000..9366456 Binary files /dev/null and b/lx-icons/256/settings-2.png differ diff --git a/lx-icons/256/settings.png b/lx-icons/256/settings.png new file mode 100644 index 0000000..8ed6a03 Binary files /dev/null and b/lx-icons/256/settings.png differ diff --git a/lx-icons/256/trash.png b/lx-icons/256/trash.png new file mode 100644 index 0000000..73e6966 Binary files /dev/null and b/lx-icons/256/trash.png differ diff --git a/lx-icons/32/arrow-left.png b/lx-icons/32/arrow-left.png new file mode 100644 index 0000000..8a7ea07 Binary files /dev/null and b/lx-icons/32/arrow-left.png differ diff --git a/lx-icons/32/arrow-right.png b/lx-icons/32/arrow-right.png new file mode 100644 index 0000000..c1a4d70 Binary files /dev/null and b/lx-icons/32/arrow-right.png differ diff --git a/lx-icons/32/arrow-up.png b/lx-icons/32/arrow-up.png new file mode 100644 index 0000000..9e28b0b Binary files /dev/null and b/lx-icons/32/arrow-up.png differ diff --git a/lx-icons/32/audio.png b/lx-icons/32/audio.png new file mode 100644 index 0000000..0058d3d Binary files /dev/null and b/lx-icons/32/audio.png differ diff --git a/lx-icons/32/carrel.png b/lx-icons/32/carrel.png new file mode 100644 index 0000000..db92321 Binary files /dev/null and b/lx-icons/32/carrel.png differ diff --git a/lx-icons/32/computer.png b/lx-icons/32/computer.png new file mode 100644 index 0000000..4fa0929 Binary files /dev/null and b/lx-icons/32/computer.png differ diff --git a/lx-icons/32/device.png b/lx-icons/32/device.png new file mode 100644 index 0000000..4acb0fd Binary files /dev/null and b/lx-icons/32/device.png differ diff --git a/lx-icons/32/document.png b/lx-icons/32/document.png new file mode 100644 index 0000000..a9df045 Binary files /dev/null and b/lx-icons/32/document.png differ diff --git a/lx-icons/32/file-python.png b/lx-icons/32/file-python.png new file mode 100644 index 0000000..6d9b8d4 Binary files /dev/null and b/lx-icons/32/file-python.png differ diff --git a/lx-icons/32/folder-water-documents.png b/lx-icons/32/folder-water-documents.png new file mode 100644 index 0000000..6b83a4f Binary files /dev/null and b/lx-icons/32/folder-water-documents.png differ diff --git a/lx-icons/32/folder-water-download.png b/lx-icons/32/folder-water-download.png new file mode 100644 index 0000000..4df8e0f Binary files /dev/null and b/lx-icons/32/folder-water-download.png differ diff --git a/lx-icons/32/folder-water-music.png b/lx-icons/32/folder-water-music.png new file mode 100644 index 0000000..0508a96 Binary files /dev/null and b/lx-icons/32/folder-water-music.png differ diff --git a/lx-icons/32/folder-water-pictures.png b/lx-icons/32/folder-water-pictures.png new file mode 100644 index 0000000..3127112 Binary files /dev/null and b/lx-icons/32/folder-water-pictures.png differ diff --git a/lx-icons/32/folder-water-video.png b/lx-icons/32/folder-water-video.png new file mode 100644 index 0000000..8f303c5 Binary files /dev/null and b/lx-icons/32/folder-water-video.png differ diff --git a/lx-icons/32/folder-water.png b/lx-icons/32/folder-water.png new file mode 100644 index 0000000..1d3560a Binary files /dev/null and b/lx-icons/32/folder-water.png differ diff --git a/lx-icons/32/hide.png b/lx-icons/32/hide.png new file mode 100644 index 0000000..9372f72 Binary files /dev/null and b/lx-icons/32/hide.png differ diff --git a/lx-icons/32/home.png b/lx-icons/32/home.png new file mode 100644 index 0000000..df5c3ac Binary files /dev/null and b/lx-icons/32/home.png differ diff --git a/lx-icons/32/list.png b/lx-icons/32/list.png new file mode 100644 index 0000000..1e47a0e Binary files /dev/null and b/lx-icons/32/list.png differ diff --git a/lx-icons/32/lxtools_key.png b/lx-icons/32/lxtools_key.png new file mode 100644 index 0000000..01f50a6 Binary files /dev/null and b/lx-icons/32/lxtools_key.png differ diff --git a/lx-icons/32/media-optical.png b/lx-icons/32/media-optical.png new file mode 100644 index 0000000..449ab36 Binary files /dev/null and b/lx-icons/32/media-optical.png differ diff --git a/lx-icons/32/new-document.png b/lx-icons/32/new-document.png new file mode 100644 index 0000000..233e410 Binary files /dev/null and b/lx-icons/32/new-document.png differ diff --git a/lx-icons/32/new-folder.png b/lx-icons/32/new-folder.png new file mode 100644 index 0000000..268ba06 Binary files /dev/null and b/lx-icons/32/new-folder.png differ diff --git a/lx-icons/32/pdf.png b/lx-icons/32/pdf.png new file mode 100644 index 0000000..34fc0e6 Binary files /dev/null and b/lx-icons/32/pdf.png differ diff --git a/lx-icons/32/picture.png b/lx-icons/32/picture.png new file mode 100644 index 0000000..9b8c448 Binary files /dev/null and b/lx-icons/32/picture.png differ diff --git a/lx-icons/32/recursive.png b/lx-icons/32/recursive.png new file mode 100644 index 0000000..c50cb12 Binary files /dev/null and b/lx-icons/32/recursive.png differ diff --git a/lx-icons/32/search.png b/lx-icons/32/search.png new file mode 100644 index 0000000..f97a8f7 Binary files /dev/null and b/lx-icons/32/search.png differ diff --git a/lx-icons/32/settings-2.png b/lx-icons/32/settings-2.png new file mode 100644 index 0000000..ff67e84 Binary files /dev/null and b/lx-icons/32/settings-2.png differ diff --git a/lx-icons/32/settings.png b/lx-icons/32/settings.png new file mode 100644 index 0000000..f91c725 Binary files /dev/null and b/lx-icons/32/settings.png differ diff --git a/lx-icons/32/tar.png b/lx-icons/32/tar.png new file mode 100644 index 0000000..5043933 Binary files /dev/null and b/lx-icons/32/tar.png differ diff --git a/lx-icons/32/trash.png b/lx-icons/32/trash.png new file mode 100644 index 0000000..2d39cfb Binary files /dev/null and b/lx-icons/32/trash.png differ diff --git a/lx-icons/32/unhide.png b/lx-icons/32/unhide.png new file mode 100644 index 0000000..424203c Binary files /dev/null and b/lx-icons/32/unhide.png differ diff --git a/lx-icons/32/usb.png b/lx-icons/32/usb.png new file mode 100644 index 0000000..0e42943 Binary files /dev/null and b/lx-icons/32/usb.png differ diff --git a/lx-icons/32/video.png b/lx-icons/32/video.png new file mode 100644 index 0000000..cb5de25 Binary files /dev/null and b/lx-icons/32/video.png differ diff --git a/lx-icons/48/arrow-left.png b/lx-icons/48/arrow-left.png new file mode 100644 index 0000000..528be77 Binary files /dev/null and b/lx-icons/48/arrow-left.png differ diff --git a/lx-icons/48/arrow-right.png b/lx-icons/48/arrow-right.png new file mode 100644 index 0000000..c1ff69b Binary files /dev/null and b/lx-icons/48/arrow-right.png differ diff --git a/lx-icons/48/arrow-up.png b/lx-icons/48/arrow-up.png new file mode 100644 index 0000000..82f5363 Binary files /dev/null and b/lx-icons/48/arrow-up.png differ diff --git a/lx-icons/48/carrel.png b/lx-icons/48/carrel.png new file mode 100644 index 0000000..63e1cd3 Binary files /dev/null and b/lx-icons/48/carrel.png differ diff --git a/lx-icons/48/computer.png b/lx-icons/48/computer.png new file mode 100644 index 0000000..a0bb285 Binary files /dev/null and b/lx-icons/48/computer.png differ diff --git a/lx-icons/48/device.png b/lx-icons/48/device.png new file mode 100644 index 0000000..07a7947 Binary files /dev/null and b/lx-icons/48/device.png differ diff --git a/lx-icons/48/folder-water-documents.png b/lx-icons/48/folder-water-documents.png new file mode 100644 index 0000000..5bb9afd Binary files /dev/null and b/lx-icons/48/folder-water-documents.png differ diff --git a/lx-icons/48/folder-water-download.png b/lx-icons/48/folder-water-download.png new file mode 100644 index 0000000..4e36de1 Binary files /dev/null and b/lx-icons/48/folder-water-download.png differ diff --git a/lx-icons/48/folder-water-music.png b/lx-icons/48/folder-water-music.png new file mode 100644 index 0000000..e1b1894 Binary files /dev/null and b/lx-icons/48/folder-water-music.png differ diff --git a/lx-icons/48/folder-water-pictures.png b/lx-icons/48/folder-water-pictures.png new file mode 100644 index 0000000..830286d Binary files /dev/null and b/lx-icons/48/folder-water-pictures.png differ diff --git a/lx-icons/48/folder-water-video.png b/lx-icons/48/folder-water-video.png new file mode 100644 index 0000000..d2ff3fa Binary files /dev/null and b/lx-icons/48/folder-water-video.png differ diff --git a/lx-icons/48/folder-water.png b/lx-icons/48/folder-water.png new file mode 100644 index 0000000..4e44bff Binary files /dev/null and b/lx-icons/48/folder-water.png differ diff --git a/lx-icons/48/hide.png b/lx-icons/48/hide.png new file mode 100644 index 0000000..b8cd572 Binary files /dev/null and b/lx-icons/48/hide.png differ diff --git a/lx-icons/48/home.png b/lx-icons/48/home.png new file mode 100644 index 0000000..7d278af Binary files /dev/null and b/lx-icons/48/home.png differ diff --git a/lx-icons/48/list.png b/lx-icons/48/list.png new file mode 100644 index 0000000..575a95b Binary files /dev/null and b/lx-icons/48/list.png differ diff --git a/lx-icons/48/new-document.png b/lx-icons/48/new-document.png new file mode 100644 index 0000000..81dc70a Binary files /dev/null and b/lx-icons/48/new-document.png differ diff --git a/lx-icons/48/new-folder.png b/lx-icons/48/new-folder.png new file mode 100644 index 0000000..4f9bedd Binary files /dev/null and b/lx-icons/48/new-folder.png differ diff --git a/lx-icons/48/recursive.png b/lx-icons/48/recursive.png new file mode 100644 index 0000000..bf021da Binary files /dev/null and b/lx-icons/48/recursive.png differ diff --git a/lx-icons/48/search.png b/lx-icons/48/search.png new file mode 100644 index 0000000..a2cd573 Binary files /dev/null and b/lx-icons/48/search.png differ diff --git a/lx-icons/48/settings-2.png b/lx-icons/48/settings-2.png new file mode 100644 index 0000000..0b3f7bd Binary files /dev/null and b/lx-icons/48/settings-2.png differ diff --git a/lx-icons/48/settings.png b/lx-icons/48/settings.png new file mode 100644 index 0000000..21fb59e Binary files /dev/null and b/lx-icons/48/settings.png differ diff --git a/lx-icons/48/trash.png b/lx-icons/48/trash.png new file mode 100644 index 0000000..5f391f5 Binary files /dev/null and b/lx-icons/48/trash.png differ diff --git a/lx-icons/48/unhide.png b/lx-icons/48/unhide.png new file mode 100644 index 0000000..33bfd43 Binary files /dev/null and b/lx-icons/48/unhide.png differ diff --git a/lx-icons/48/usb.png b/lx-icons/48/usb.png new file mode 100644 index 0000000..a107512 Binary files /dev/null and b/lx-icons/48/usb.png differ diff --git a/lx-icons/64/arrow-left.png b/lx-icons/64/arrow-left.png new file mode 100644 index 0000000..a9ddb04 Binary files /dev/null and b/lx-icons/64/arrow-left.png differ diff --git a/lx-icons/64/arrow-right.png b/lx-icons/64/arrow-right.png new file mode 100644 index 0000000..e68c045 Binary files /dev/null and b/lx-icons/64/arrow-right.png differ diff --git a/lx-icons/64/arrow-up.png b/lx-icons/64/arrow-up.png new file mode 100644 index 0000000..e3081dc Binary files /dev/null and b/lx-icons/64/arrow-up.png differ diff --git a/lx-icons/64/audio.png b/lx-icons/64/audio.png new file mode 100644 index 0000000..98a91ec Binary files /dev/null and b/lx-icons/64/audio.png differ diff --git a/lx-icons/64/carrel.png b/lx-icons/64/carrel.png new file mode 100644 index 0000000..af5a5aa Binary files /dev/null and b/lx-icons/64/carrel.png differ diff --git a/lx-icons/64/computer.png b/lx-icons/64/computer.png new file mode 100644 index 0000000..f15e0e6 Binary files /dev/null and b/lx-icons/64/computer.png differ diff --git a/lx-icons/64/device.png b/lx-icons/64/device.png new file mode 100644 index 0000000..d0a099e Binary files /dev/null and b/lx-icons/64/device.png differ diff --git a/lx-icons/64/document.png b/lx-icons/64/document.png new file mode 100644 index 0000000..f6cb0c8 Binary files /dev/null and b/lx-icons/64/document.png differ diff --git a/lx-icons/64/file-python.png b/lx-icons/64/file-python.png new file mode 100644 index 0000000..9bbed59 Binary files /dev/null and b/lx-icons/64/file-python.png differ diff --git a/lx-icons/64/folder-water-documents.png b/lx-icons/64/folder-water-documents.png new file mode 100644 index 0000000..cbc7ff8 Binary files /dev/null and b/lx-icons/64/folder-water-documents.png differ diff --git a/lx-icons/64/folder-water-download.png b/lx-icons/64/folder-water-download.png new file mode 100644 index 0000000..7e5a242 Binary files /dev/null and b/lx-icons/64/folder-water-download.png differ diff --git a/lx-icons/64/folder-water-music.png b/lx-icons/64/folder-water-music.png new file mode 100644 index 0000000..3c39c81 Binary files /dev/null and b/lx-icons/64/folder-water-music.png differ diff --git a/lx-icons/64/folder-water-pictures.png b/lx-icons/64/folder-water-pictures.png new file mode 100644 index 0000000..5f2fa2f Binary files /dev/null and b/lx-icons/64/folder-water-pictures.png differ diff --git a/lx-icons/64/folder-water-video.png b/lx-icons/64/folder-water-video.png new file mode 100644 index 0000000..ddfcce5 Binary files /dev/null and b/lx-icons/64/folder-water-video.png differ diff --git a/lx-icons/64/folder-water.png b/lx-icons/64/folder-water.png new file mode 100644 index 0000000..7f1b4cd Binary files /dev/null and b/lx-icons/64/folder-water.png differ diff --git a/lx-icons/64/hide.png b/lx-icons/64/hide.png new file mode 100644 index 0000000..91a4194 Binary files /dev/null and b/lx-icons/64/hide.png differ diff --git a/lx-icons/64/home.png b/lx-icons/64/home.png new file mode 100644 index 0000000..cc46bcf Binary files /dev/null and b/lx-icons/64/home.png differ diff --git a/lx-icons/64/list.png b/lx-icons/64/list.png new file mode 100644 index 0000000..1e57b0d Binary files /dev/null and b/lx-icons/64/list.png differ diff --git a/lx-icons/64/media-optical.png b/lx-icons/64/media-optical.png new file mode 100644 index 0000000..80d3d2f Binary files /dev/null and b/lx-icons/64/media-optical.png differ diff --git a/lx-icons/64/new-document.png b/lx-icons/64/new-document.png new file mode 100644 index 0000000..3fb032d Binary files /dev/null and b/lx-icons/64/new-document.png differ diff --git a/lx-icons/64/new-folder.png b/lx-icons/64/new-folder.png new file mode 100644 index 0000000..2c3fb52 Binary files /dev/null and b/lx-icons/64/new-folder.png differ diff --git a/lx-icons/64/pdf.png b/lx-icons/64/pdf.png new file mode 100644 index 0000000..6b41605 Binary files /dev/null and b/lx-icons/64/pdf.png differ diff --git a/lx-icons/64/picture.png b/lx-icons/64/picture.png new file mode 100644 index 0000000..61c337e Binary files /dev/null and b/lx-icons/64/picture.png differ diff --git a/lx-icons/64/recursive.png b/lx-icons/64/recursive.png new file mode 100644 index 0000000..ac03897 Binary files /dev/null and b/lx-icons/64/recursive.png differ diff --git a/lx-icons/64/search.png b/lx-icons/64/search.png new file mode 100644 index 0000000..253c85a Binary files /dev/null and b/lx-icons/64/search.png differ diff --git a/lx-icons/64/settings-2.png b/lx-icons/64/settings-2.png new file mode 100644 index 0000000..b459066 Binary files /dev/null and b/lx-icons/64/settings-2.png differ diff --git a/lx-icons/64/settings.png b/lx-icons/64/settings.png new file mode 100644 index 0000000..4a3b304 Binary files /dev/null and b/lx-icons/64/settings.png differ diff --git a/lx-icons/64/tar.png b/lx-icons/64/tar.png new file mode 100644 index 0000000..e2887ce Binary files /dev/null and b/lx-icons/64/tar.png differ diff --git a/lx-icons/64/trash.png b/lx-icons/64/trash.png new file mode 100644 index 0000000..49c1f67 Binary files /dev/null and b/lx-icons/64/trash.png differ diff --git a/lx-icons/64/unhide.png b/lx-icons/64/unhide.png new file mode 100644 index 0000000..aa63b5b Binary files /dev/null and b/lx-icons/64/unhide.png differ diff --git a/lx-icons/64/usb.png b/lx-icons/64/usb.png new file mode 100644 index 0000000..5127e97 Binary files /dev/null and b/lx-icons/64/usb.png differ diff --git a/lx-icons/64/video.png b/lx-icons/64/video.png new file mode 100644 index 0000000..a087590 Binary files /dev/null and b/lx-icons/64/video.png differ diff --git a/ssl_decrypt.py b/ssl_decrypt.py index 9f64711..bda3ae4 100755 --- a/ssl_decrypt.py +++ b/ssl_decrypt.py @@ -7,13 +7,15 @@ import shutil from subprocess import CompletedProcess, run from shared_libs.wp_app_config import AppConfig from shared_libs.message import MessageDialog +from shared_libs.common_tools import Translate parser = argparse.ArgumentParser() -parser.add_argument("--user", required=True, help="Username of the target file system") +parser.add_argument("--user", required=True, + help="Username of the target file system") args = parser.parse_args() -_ = AppConfig.setup_translations() +_ = Translate.setup_translations("wirepy") try: # Retrieve UID and GID user_info = pwd.getpwnam(args.user) @@ -59,7 +61,7 @@ else: MessageDialog( "error", _( - f"{process.stderr} Error by [{tunnel_path}] Code: {process.returncode}" + f"{process.stderr} Error by [{tunnel_path}]" ), title="Error decrypt", ).show() diff --git a/ssl_encrypt.py b/ssl_encrypt.py index 788e026..fd581bf 100755 --- a/ssl_encrypt.py +++ b/ssl_encrypt.py @@ -11,7 +11,8 @@ from shared_libs.wp_app_config import AppConfig from shared_libs.common_tools import LogConfig parser = argparse.ArgumentParser() -parser.add_argument("--user", required=True, help="Username of the target file system") +parser.add_argument("--user", required=True, + help="Username of the target file system") args = parser.parse_args() LogConfig.logger(f"/home/{args.user}/.local/share/lxlogs/wirepy.log") @@ -21,7 +22,7 @@ try: uid = user_info.pw_uid # User ID (e.g., 1000) gid = user_info.pw_gid # Group ID (e.g., 1000) except KeyError: - logging.error(f"User '{args.user}' not found.", exc_info=True) + logging.error(f"User '{args.user}' not found.") exit(1) keyfile: Path = Path(f"/home/{args.user}/.config/wire_py/pbwgk.pem") @@ -49,10 +50,13 @@ if not keyfile.is_file(): # Output from Openssl Error if process.stderr: - logging.error(f"{process.stderr} Code: {process.returncode}", exc_info=True) + if "writing RSA key" in process.stderr: + logging.info(f"{process.stderr}") + else: + logging.error(f"{process.stderr}") if process.returncode == 0: - logging.info("Public key generated successfully.", exc_info=True) + logging.info("Public key generated successfully.") shutil.chown(keyfile, uid, gid) @@ -82,4 +86,4 @@ if AppConfig.TEMP_DIR.exists() and any(AppConfig.TEMP_DIR.iterdir()): # Output from Openssl Error if process.stderr: - logging.error(process.stderr, exc_info=True) + logging.error(process.stderr) diff --git a/start_wg.py b/start_wg.py index 3336915..6491666 100755 --- a/start_wg.py +++ b/start_wg.py @@ -18,7 +18,7 @@ if ConfigManager.get("autostart") != "off": ) # Output from start_wg error if process.stderr: - logging.error(process.stderr, exc_info=True) + logging.error(process.stderr) else: pass diff --git a/tunnel.py b/tunnel.py index 4347ed0..6cd66f2 100644 --- a/tunnel.py +++ b/tunnel.py @@ -11,9 +11,6 @@ from shared_libs.wp_app_config import AppConfig, Msg from shared_libs.common_tools import LxTools, CryptoUtil from shared_libs.message import MessageDialog -# Translate -_ = AppConfig.setup_translations() - class Tunnel: """ @@ -58,7 +55,8 @@ class Tunnel: # Shorten the tunnel name to the maximum allowed length if it exceeds 12 characters. original_stem = filepath.stem truncated_stem = ( - original_stem[-12:] if len(original_stem) > 12 else original_stem + original_stem[-12:] if len( + original_stem) > 12 else original_stem ) # save in the dictionary @@ -78,13 +76,12 @@ class Tunnel: if not directory.exists() or not directory.is_dir(): logging.error( - "Temp directory does not exist or is not a directory.", - exc_info=True, - ) + "Temp directory does not exist or is not a directory.") return None # Get a list of all files in the directory - files = [file for file in AppConfig.TEMP_DIR.iterdir() if file.is_file()] + files = [file for file in AppConfig.TEMP_DIR.iterdir() + if file.is_file()] # Search for the string in the files for file in files: @@ -135,7 +132,8 @@ class Tunnel: active = None try: process: CompletedProcess[str] = run( - ["nmcli", "-t", "-f", "NAME,TYPE", "connection", "show", "--active"], + ["nmcli", "-t", "-f", "NAME,TYPE", + "connection", "show", "--active"], capture_output=True, text=True, check=False, @@ -173,7 +171,8 @@ class Tunnel: CryptoUtil.decrypt(getpass.getuser()) if len([file.name for file in AppConfig.TEMP_DIR.glob("*.conf")]) == 0: - MessageDialog("info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"]) + MessageDialog( + "info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"]) return False else: @@ -212,7 +211,8 @@ class Tunnel: pass except Exception as e: logging.error(f"Export failed: {str(e)}") - MessageDialog("error", Msg.STR["exp_try"], title=Msg.STR["exp_err"]) + MessageDialog( + "error", Msg.STR["exp_try"], title=Msg.STR["exp_err"]) return False finally: diff --git a/wirepy.py b/wirepy.py index bfb3bb9..49a1f25 100755 --- a/wirepy.py +++ b/wirepy.py @@ -24,9 +24,10 @@ from shared_libs.common_tools import ( ConfigManager, ThemeManager, Tooltip, + IconManager, ) -from shared_libs.wp_app_config import AppConfig, Image, Msg +from shared_libs.wp_app_config import AppConfig, Msg class Wirepy(tk.Tk): @@ -51,20 +52,22 @@ class Wirepy(tk.Tk): AppConfig.UI_CONFIG["resizable_window"][0], AppConfig.UI_CONFIG["resizable_window"][1], ) + self.minsize( AppConfig.UI_CONFIG["window_size"][0], AppConfig.UI_CONFIG["window_size"][1], ) self.title(AppConfig.UI_CONFIG["window_title"]) - self.image_manager = Image() - self.tk.call("source", f"{AppConfig.SYSTEM_PATHS['tcl_path']}/water.tcl") + self.image_manager = IconManager() + self.tk.call( + "source", f"{AppConfig.SYSTEM_PATHS['tcl_path']}/water.tcl") ConfigManager.init(AppConfig.SETTINGS_FILE) theme = ConfigManager.get("theme") ThemeManager.change_theme(self, theme) # Try to set icon try: - icon = self.image_manager.load_image("icon_vpn") + icon = self.image_manager.get_icon("vpn_small") if icon: self.iconphoto(True, icon) except: @@ -96,7 +99,7 @@ class FrameWidgets(ttk.Frame): self.dns = None self.address = None self.auto_con = None - self.image_manager = Image() + self.image_manager = IconManager() self.columnconfigure(0, weight=1) self.rowconfigure(0, weight=1) self.columnconfigure(1, weight=1) @@ -134,26 +137,30 @@ class FrameWidgets(ttk.Frame): self.menu_frame = ttk.Frame(self) self.menu_frame.grid(column=0, columnspan=3, row=1, sticky="we") - self.options_btn = ttk.Menubutton(self.menu_frame, text=_("Options")) + self.options_btn = ttk.Menubutton( + self.menu_frame, text=Msg.STR["options"]) self.options_btn.grid(column=0, row=0) - Tooltip(self.options_btn, Msg.TTIP["settings"], self.tooltip_state) + Tooltip(self.options_btn, + Msg.TTIP["settings"], state_var=self.tooltip_state) self.set_update = tk.IntVar() self.settings = tk.Menu(self, relief="flat") self.options_btn.configure(menu=self.settings, style="Toolbutton") self.settings.add_checkbutton( - label=_("Disable Updates"), + label=Msg.STR["disable_updates"], command=lambda: self.update_setting(self.set_update.get()), variable=self.set_update, ) - self.updates_lb = ttk.Label(self.menu_frame, textvariable=self.update_label) + self.updates_lb = ttk.Label( + self.menu_frame, textvariable=self.update_label) self.updates_lb.grid(column=2, row=0) self.updates_lb.grid_remove() self.update_label.trace_add("write", self.update_label_display) self.update_foreground.trace_add("write", self.update_label_display) res = GiteaUpdate.api_down( - AppConfig.UPDATE_URL, AppConfig.VERSION, ConfigManager.get("updates") + AppConfig.UPDATE_URL, AppConfig.VERSION, ConfigManager.get( + "updates") ) self.update_ui_for_update(res) @@ -174,7 +181,7 @@ class FrameWidgets(ttk.Frame): ) # About BTN Menu / Label self.about_btn = ttk.Button( - self.menu_frame, text=_("About"), style="Toolbutton", command=self.about + self.menu_frame, text=Msg.STR["about"], style="Toolbutton", command=self.about ) self.about_btn.grid(column=1, row=0) @@ -186,7 +193,7 @@ class FrameWidgets(ttk.Frame): self.wg_icon_header_frame = tk.Frame(self.header_frame, bg="#2c3e50") self.header_label = tk.Label( self.header_frame, - text=_("Lx Tools Wire-Py"), + text=Msg.STR["lx_tools"], font=("Helvetica", 12, "bold"), fg="#ffffff", bg="#2c3e50", @@ -211,7 +218,7 @@ class FrameWidgets(ttk.Frame): self.wg_icon_header_label = tk.Label( self.wg_icon_header_frame, - image=self.image_manager.load_image("icon_header"), + image=self.image_manager.get_icon("vpn_small"), bg="#2c3e50", ) self.wg_icon_header_label.grid(column=0, row=0, sticky="e", ipadx=10) @@ -224,14 +231,17 @@ class FrameWidgets(ttk.Frame): pady=(15, 5), ipady=4, ) - self.version_label.grid(column=1, row=1, sticky="w", padx=(5, 20), pady=(0, 10)) - self.info_label.grid(column=2, row=0, sticky="ne", padx=(10, 10), pady=(10, 0)) + self.version_label.grid( + column=1, row=1, sticky="w", padx=(5, 20), pady=(0, 10)) + self.info_label.grid(column=2, row=0, sticky="ne", + padx=(10, 10), pady=(10, 0)) self.header_frame.columnconfigure(1, weight=1, pad=2) self.header_frame.rowconfigure(0, weight=1) # Frame for Control Buttons (Start, Stop, Import, Trash, Export) self.control_buttons_frame = ttk.Frame(self) - self.control_buttons_frame.grid(column=0, row=2, sticky="w", padx=(15, 0)) + self.control_buttons_frame.grid( + column=0, row=2, sticky="w", padx=(15, 0)) self.control_buttons_frame.columnconfigure(0, weight=1) self.control_buttons_frame.rowconfigure(2, weight=1) @@ -240,7 +250,8 @@ class FrameWidgets(ttk.Frame): self.list_container_frame.grid(column=1, row=2, sticky="nsew") self.list_container_frame.columnconfigure(1, weight=1) self.list_container_frame.rowconfigure(2, weight=1) - self.list_frame = ttk.LabelFrame(self.list_container_frame, text=_("Tunnels")) + self.list_frame = ttk.LabelFrame( + self.list_container_frame, text=Msg.STR["tunnels"]) self.list_frame.grid(column=0, row=0, sticky="nsew", padx=10, ipady=20) # Listbox with Scrollbar self.list_box = tk.Listbox(self.list_frame, selectmode="single") @@ -269,7 +280,7 @@ class FrameWidgets(ttk.Frame): # Show active Label self.select_tunnel = None self.active_frame = ttk.LabelFrame( - self.right_side_frame, text=_("Active Tunnel") + self.right_side_frame, text=Msg.STR["active_tunnel"] ) self.active_frame.grid( @@ -279,7 +290,7 @@ class FrameWidgets(ttk.Frame): self.active_frame.rowconfigure(0, weight=1) # Interface Label Frame self.interface_frame = ttk.LabelFrame( - self.right_side_frame, text=_("Interface") + self.right_side_frame, text=Msg.STR["interface"] ) self.interface_frame.grid( column=0, row=1, sticky="nsew", padx=10, pady=5, columnspan=3 @@ -288,7 +299,8 @@ class FrameWidgets(ttk.Frame): self.interface_frame.rowconfigure(1, weight=1) # Peer Label Frame - self.peer_frame = ttk.LabelFrame(self.right_side_frame, text=_("Peer")) + self.peer_frame = ttk.LabelFrame( + self.right_side_frame, text=Msg.STR["peer"]) self.peer_frame.grid( column=0, row=2, sticky="nsew", padx=10, pady=5, columnspan=3 ) @@ -320,7 +332,8 @@ class FrameWidgets(ttk.Frame): self.peer.grid(column=0, row=5, sticky="we") # Tunnel List - self.tl = Tunnel.parse_files_to_dictionary(directory=AppConfig.TEMP_DIR) + self.tl = Tunnel.parse_files_to_dictionary( + directory=AppConfig.TEMP_DIR) LxTools.clean_files(AppConfig.TEMP_DIR, file=None) AppConfig.ensure_directories() @@ -346,32 +359,35 @@ class FrameWidgets(ttk.Frame): # Button Import self.btn_i = ttk.Button( self.control_buttons_frame, - image=self.image_manager.load_image("icon_import"), + image=self.image_manager.get_icon("import_large"), command=self.import_sl, padding=0, ) self.btn_i.grid(column=0, row=1, pady=8) - Tooltip(self.btn_i, Msg.TTIP["import_tl"], self.tooltip_state) + Tooltip(self.btn_i, Msg.TTIP["import_tl"], + state_var=self.tooltip_state) # Button Trash self.btn_tr = ttk.Button( self.control_buttons_frame, - image=self.image_manager.load_image("icon_trash"), + image=self.image_manager.get_icon("trash_large"), command=self.delete, padding=0, ) self.btn_tr.grid(column=0, row=2, pady=8) if self.list_box.size() == 0: - Tooltip(self.btn_tr, Msg.TTIP["trash_tl_info"], self.tooltip_state) + Tooltip(self.btn_tr, + Msg.TTIP["trash_tl_info"], state_var=self.tooltip_state) else: - Tooltip(self.btn_tr, Msg.TTIP["trash_tl"], self.tooltip_state) + Tooltip(self.btn_tr, Msg.TTIP["trash_tl"], + state_var=self.tooltip_state) # Button Export self.btn_exp = ttk.Button( self.control_buttons_frame, - image=self.image_manager.load_image("icon_export"), + image=self.image_manager.get_icon("export_large"), command=lambda: Tunnel.export(), padding=0, ) @@ -381,39 +397,35 @@ class FrameWidgets(ttk.Frame): self.btn_exp.rowconfigure(3, weight=1) if self.list_box.size() == 0: - Tooltip(self.btn_exp, Msg.TTIP["export_tl_info"], self.tooltip_state) + Tooltip(self.btn_exp, + Msg.TTIP["export_tl_info"], state_var=self.tooltip_state) else: - Tooltip(self.btn_exp, Msg.TTIP["export_tl"], self.tooltip_state) + Tooltip(self.btn_exp, + Msg.TTIP["export_tl"], state_var=self.tooltip_state) # Label Entry self.lb_rename = ttk.Entry(self.rename_frame) self.lb_rename.grid(column=0, row=0, padx=8, pady=10, sticky="ne") self.lb_rename.config(width=15) - self.lb_rename.insert(0, _("Max. 12 characters!")) + self.lb_rename.insert(0, Msg.STR["max_chars"]) self.lb_rename.config(state="disable") if self.list_box.size() != 0: Tooltip( self.lb_rename, Msg.TTIP["rename_tl"], - self.tooltip_state, - x_offset=-120, - y_offset=-70, - ) + state_var=self.tooltip_state) else: Tooltip( self.lb_rename, Msg.TTIP["rename_tl_info"], - self.tooltip_state, - x_offset=-180, - y_offset=-50, - ) + state_var=self.tooltip_state) # Button Rename self.btn_rename = ttk.Button( self.rename_frame, - text=_("Rename"), + text=Msg.STR["rename"], state="disable", command=self.tl_rename, width=15, @@ -427,7 +439,8 @@ class FrameWidgets(ttk.Frame): # Frame for Labels, Entry and Button self.autoconnect = ttk.Label( - self.autoconnect_frame, textvariable=self.autoconnect_var + self.autoconnect_frame, + textvariable=self.autoconnect_var ) self.autoconnect.config(font=("Ubuntu", 11)) self.autoconnect.grid(column=1, row=0, pady=10, sticky="nsew") @@ -435,39 +448,31 @@ class FrameWidgets(ttk.Frame): self.autoconnect.rowconfigure(0, weight=1) self.wg_autostart = ttk.Checkbutton( self.autoconnect_frame, - text=_("Autoconnect on:"), + text=Msg.STR["autoconnect_on"], variable=self.selected_option, command=self.box_set, ) - self.wg_autostart.grid(column=0, row=0, pady=10, padx=(10, 0), sticky="ew") + self.wg_autostart.grid(column=0, row=0, pady=10, + padx=(10, 0), sticky="ew") if self.list_box.size() >= 1 and len(self.list_box.curselection()) >= 1: Tooltip( self.wg_autostart, Msg.TTIP["autostart"], - self.tooltip_state, - x_offset=-10, - y_offset=-40, - ) + state_var=self.tooltip_state) if self.list_box.size() == 0: Tooltip( self.wg_autostart, Msg.TTIP["autostart_info"], - self.tooltip_state, - x_offset=30, - y_offset=-50, - ) + state_var=self.tooltip_state) else: Tooltip( self.wg_autostart, Msg.TTIP["autostart"], - self.tooltip_state, - x_offset=-10, - y_offset=-40, - ) + state_var=self.tooltip_state) self.on_off() @@ -488,7 +493,8 @@ class FrameWidgets(ttk.Frame): tmp_dir = Path("/tmp/lxtools") Path.mkdir(tmp_dir, exist_ok=True) os.chdir(tmp_dir) - result = subprocess.run(["/usr/local/bin/lxtools_installer"], check=False) + result = subprocess.run( + ["/usr/local/bin/lxtools_installer"], check=False) if result.returncode != 0: MessageDialog("error", result.stderr) @@ -502,29 +508,32 @@ class FrameWidgets(ttk.Frame): if res == "False": self.set_update.set(value=1) - self.update_label.set(_("Update search off")) - self.update_tooltip.set(_("Updates you have disabled")) + self.update_label.set(Msg.STR["update_search_off"]) + self.update_tooltip.set(Msg.TTIP["updates_disabled"]) # Clear the foreground color as requested self.update_foreground.set("") # Set the tooltip for the label - Tooltip(self.updates_lb, self.update_tooltip.get(), self.tooltip_state) + Tooltip(self.updates_lb, self.update_tooltip.get(), + state_var=self.tooltip_state) elif res == "No Internet Connection!": - self.update_label.set(_("No Server Connection!")) + self.update_label.set(Msg.STR["no_server_connection"]) self.update_foreground.set("red") # Set the tooltip for "No Server Connection" Tooltip( self.updates_lb, - _("Could not connect to update server"), - self.tooltip_state, + Msg.TTIP["no_server_conn_tt"], + state_var=self.tooltip_state, ) elif res == "No Updates": - self.update_label.set(_("No Updates")) - self.update_tooltip.set(_("Congratulations! Wire-Py is up to date")) + self.update_label.set(Msg.STR["no_updates"]) + self.update_tooltip.set( + Msg.TTIP["up_to_date"]) self.update_foreground.set("") # Set the tooltip for the label - Tooltip(self.updates_lb, self.update_tooltip.get(), self.tooltip_state) + Tooltip(self.updates_lb, self.update_tooltip.get(), + state_var=self.tooltip_state) else: self.set_update.set(value=0) @@ -535,13 +544,15 @@ class FrameWidgets(ttk.Frame): # Create the update button self.update_btn = ttk.Button( self.menu_frame, - image=self.image_manager.load_image("update"), + image=self.image_manager.get_icon("settings"), style="Toolbutton", command=self.updater, ) self.update_btn.grid(column=5, row=0, padx=0) Tooltip( - self.update_btn, _("Click to install new version"), self.tooltip_state + self.update_btn, + Msg.TTIP["install_new_version"], + state_var=self.tooltip_state ) @staticmethod @@ -549,18 +560,11 @@ class FrameWidgets(ttk.Frame): """ a tk.Toplevel window """ - msg_t = _( - "Wire-Py a simple Wireguard Gui for Linux systems.\n\n" - "Wire-Py is open source software written in Python.\n\n" - "Email: polunga40@unity-mail.de also likes for donation.\n\n" - "Use without warranty!\n" - ) - MessageDialog( "info", - msg_t, - buttons=["OK", _("Go to Wire-Py git")], - title=_("Info"), + Msg.STR["about_msg"], + buttons=["OK", Msg.STR["goto_git"]], + title=Msg.STR["info"], commands=[ None, partial(webbrowser.open, "https://git.ilunix.de/punix/Wire-Py"), @@ -598,7 +602,8 @@ class FrameWidgets(ttk.Frame): # Now update the UI with the fresh result self.update_ui_for_update(res) except Exception as e: - logging.error(f"Error checking for updates: {e}", exc_info=True) + logging.error( + f"Error checking for updates: {e}") # Fallback to a default message if there's an error self.update_ui_for_update("No Internet Connection!") @@ -607,10 +612,10 @@ class FrameWidgets(ttk.Frame): # Set the menu text based on the current status if self.tooltip_state.get(): # If tooltips are enabled, the menu option should be to disable them - self.tooltip_label.set(_("Disable Tooltips")) + self.tooltip_label.set(Msg.STR["disable_tooltips"]) else: # If tooltips are disabled, the menu option should be to enable them - self.tooltip_label.set(_("Enable Tooltips")) + self.tooltip_label.set(Msg.STR["enable_tooltips"]) def tooltips_toggle(self): """ @@ -638,9 +643,9 @@ class FrameWidgets(ttk.Frame): """Update the theme label based on the current theme""" current_theme = ConfigManager.get("theme") if current_theme == "light": - self.theme_label.set(_("Dark")) + self.theme_label.set(Msg.STR["dark"]) else: - self.theme_label.set(_("Light")) + self.theme_label.set(Msg.STR["light"]) def on_theme_toggle(self) -> None: """Toggle between light and dark theme""" @@ -660,7 +665,7 @@ class FrameWidgets(ttk.Frame): """ self.btn_stst = ttk.Button( self.control_buttons_frame, - image=self.image_manager.load_image("icon_start"), + image=self.image_manager.get_icon("vpn_start_large"), command=lambda: self.wg_switch("start"), padding=0, ) @@ -669,9 +674,11 @@ class FrameWidgets(ttk.Frame): self.btn_stst.rowconfigure(0, weight=1) if self.list_box.size() == 0: - Tooltip(self.btn_stst, Msg.TTIP["empty_list"], self.tooltip_state) + Tooltip(self.btn_stst, + Msg.TTIP["empty_list"], state_var=self.tooltip_state) else: - Tooltip(self.btn_stst, Msg.TTIP["start_tl"], self.tooltip_state) + Tooltip(self.btn_stst, + Msg.TTIP["start_tl"], state_var=self.tooltip_state) def color_label(self) -> None: """ @@ -699,7 +706,7 @@ class FrameWidgets(ttk.Frame): """ self.btn_stst = ttk.Button( self.control_buttons_frame, - image=self.image_manager.load_image("icon_stop"), + image=self.image_manager.get_icon("vpn_stop_large"), command=lambda: self.wg_switch("stop"), padding=0, ) @@ -707,7 +714,8 @@ class FrameWidgets(ttk.Frame): self.btn_stst.columnconfigure(0, weight=1) self.btn_stst.rowconfigure(0, weight=1) - Tooltip(self.btn_stst, Msg.TTIP["stop_tl"], self.tooltip_state) + Tooltip(self.btn_stst, Msg.TTIP["stop_tl"], + state_var=self.tooltip_state) def reset_fields(self) -> None: """ @@ -727,10 +735,12 @@ class FrameWidgets(ttk.Frame): title="Select Wireguard config File", filetypes=[("WG config files", "*.conf")], ) - data_import, key_name = Tunnel.parse_files_to_dictionary(filepath=filepath) + data_import, key_name = Tunnel.parse_files_to_dictionary( + filepath=filepath) if CryptoUtil.find_key(f"{data_import[key_name]['PrivateKey']}="): - MessageDialog("error", Msg.STR["tl_exist"], title=Msg.STR["imp_err"]) + MessageDialog( + "error", Msg.STR["tl_exist"], title=Msg.STR["imp_err"]) elif not CryptoUtil.is_valid_base64( f"{data_import[key_name]['PrivateKey']}=" @@ -745,7 +755,8 @@ class FrameWidgets(ttk.Frame): # Shorten the tunnel name to the maximum allowed length if it exceeds 12 characters. original_name = filepath.name truncated_name = ( - original_name[-17:] if len(original_name) > 17 else original_name + original_name[-17:] if len( + original_name) > 17 else original_name ) import_file = shutil.copy2( filepath, AppConfig.TEMP_DIR / truncated_name @@ -764,7 +775,8 @@ class FrameWidgets(ttk.Frame): ) if process.stderr: - logging.error(f"{process.stderr}: Code {process.returncode}") + logging.error( + f"{process.stderr}: Code {process.returncode}") self.reset_fields() @@ -785,8 +797,7 @@ class FrameWidgets(ttk.Frame): if process.stderr: logging.error( - f"{process.stderr} Code: {process.returncode}", exc_info=True - ) + f"{process.stderr} Code: {process.returncode}") CryptoUtil.encrypt(getpass.getuser()) LxTools.clean_files(AppConfig.TEMP_DIR, file=None) @@ -802,13 +813,13 @@ class FrameWidgets(ttk.Frame): Tooltip( self.wg_autostart, Msg.TTIP["autostart"], - self.tooltip_state, - x_offset=-10, - y_offset=-40, - ) - Tooltip(self.btn_tr, Msg.TTIP["trash_tl"], self.tooltip_state) - Tooltip(self.btn_exp, Msg.TTIP["export_tl"], self.tooltip_state) - Tooltip(self.btn_rename, Msg.TTIP["rename_tl"], self.tooltip_state) + state_var=self.tooltip_state) + Tooltip(self.btn_tr, + Msg.TTIP["trash_tl"], state_var=self.tooltip_state) + Tooltip(self.btn_exp, + Msg.TTIP["export_tl"], state_var=self.tooltip_state) + Tooltip(self.btn_rename, + Msg.TTIP["rename_tl"], state_var=self.tooltip_state) self.lb_rename.insert(0, "Max. 12 characters!") self.str_var = tk.StringVar() @@ -825,13 +836,15 @@ class FrameWidgets(ttk.Frame): ) if process.stderr: - logging.error(process.stderr, exc_info=True) + logging.error(process.stderr) if process.returncode == 0: - print(f">> {import_file.stem} << autostart is disabled by default") + print( + f">> {import_file.stem} << autostart is disabled by default") except UnboundLocalError: - MessageDialog("error", Msg.STR["no_valid_file"], title=Msg.STR["imp_err"]) + MessageDialog( + "error", Msg.STR["no_valid_file"], title=Msg.STR["imp_err"]) except (IsADirectoryError, TypeError, FileNotFoundError): print("File import: abort by user...") except EOFError as e: @@ -854,8 +867,7 @@ class FrameWidgets(ttk.Frame): if process.stderr: logging.error( - f"{process.stderr} Code: {process.returncode}", exc_info=True - ) + f"{process.stderr} Code: {process.returncode}") self.list_box.delete(self.select_tunnel[0]) Path.unlink(f"{AppConfig.CONFIG_DIR}/{select_tl}.dat") @@ -863,7 +875,7 @@ class FrameWidgets(ttk.Frame): if select_tl == ConfigManager.get("autostart"): ConfigManager.set("autostart", "off") self.selected_option.set(0) - self.autoconnect_var.set(_("no Autoconnect")) + self.autoconnect_var.set(Msg.STR["no_autoconnect"]) self.wg_autostart.configure(state="disabled") @@ -874,15 +886,15 @@ class FrameWidgets(ttk.Frame): Tooltip( self.wg_autostart, Msg.TTIP["autostart_info"], - self.tooltip_state, - x_offset=30, - y_offset=-50, - ) + state_var=self.tooltip_state) - Tooltip(self.btn_exp, Msg.TTIP["export_tl_info"], self.tooltip_state) - Tooltip(self.btn_stst, Msg.TTIP["empty_list"], self.tooltip_state) - Tooltip(self.lb_rename, Msg.TTIP["rename_tl_info"], self.tooltip_state) - self.lb_rename.insert(0, _("Max. 12 characters!")) + Tooltip(self.btn_exp, + Msg.TTIP["export_tl_info"], state_var=self.tooltip_state) + Tooltip(self.btn_stst, + Msg.TTIP["empty_list"], state_var=self.tooltip_state) + Tooltip(self.lb_rename, + Msg.TTIP["rename_tl_info"], state_var=self.tooltip_state) + self.lb_rename.insert(0, Msg.STR["max_chars"]) if self.a != "" and self.a == select_tl: self.str_var.set(value="") @@ -894,11 +906,13 @@ class FrameWidgets(ttk.Frame): if self.list_box.size() != 0: - MessageDialog("info", Msg.STR["sel_list"], title=Msg.STR["sel_tl"]) + MessageDialog( + "info", Msg.STR["sel_list"], title=Msg.STR["sel_tl"]) else: - MessageDialog("info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"]) + MessageDialog( + "info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"]) def enable_check_box(self, _) -> None: """ @@ -926,7 +940,7 @@ class FrameWidgets(ttk.Frame): else: self.selected_option.set(0) - self.auto_con = _("no Autoconnect") + self.auto_con = Msg.STR["no_autoconnect"] self.autoconnect_var.set("") self.autoconnect_var = tk.StringVar() self.autoconnect_var.set(self.auto_con) @@ -982,21 +996,25 @@ class FrameWidgets(ttk.Frame): if len(self.lb_rename.get()) > 12: - MessageDialog("info", Msg.STR["sign_len"], title=Msg.STR["ren_err"]) + MessageDialog("info", Msg.STR["sign_len"], + title=Msg.STR["ren_err"]) elif len(self.lb_rename.get()) == 0: - MessageDialog("info", Msg.STR["zero_signs"], title=Msg.STR["ren_err"]) + MessageDialog( + "info", Msg.STR["zero_signs"], title=Msg.STR["ren_err"]) elif any(ch in special_characters for ch in self.lb_rename.get()): - MessageDialog("info", Msg.STR["false_signs"], title=Msg.STR["ren_err"]) + MessageDialog( + "info", Msg.STR["false_signs"], title=Msg.STR["ren_err"]) elif self.lb_rename.get() in [ file.stem for file in AppConfig.CONFIG_DIR.glob("*.dat") ]: - MessageDialog("info", Msg.STR["is_in_use"], title=Msg.STR["ren_err"]) + MessageDialog( + "info", Msg.STR["is_in_use"], title=Msg.STR["ren_err"]) else: @@ -1020,11 +1038,11 @@ class FrameWidgets(ttk.Frame): ) if process.stderr: logging.error( - f"{process.stderr} Code: {process.returncode}", exc_info=True - ) + f"{process.stderr} Code: {process.returncode}") source = Path(f"{AppConfig.CONFIG_DIR}/{select_tl}.dat") - destination = AppConfig.CONFIG_DIR / f"{self.lb_rename.get()}.dat" + destination = AppConfig.CONFIG_DIR / \ + f"{self.lb_rename.get()}.dat" source.replace(destination) self.tl[self.lb_rename.get()] = self.tl.pop(select_tl) if select_tl == ConfigManager.get("autostart"): @@ -1038,10 +1056,11 @@ class FrameWidgets(ttk.Frame): except IndexError: - MessageDialog("info", Msg.STR["sel_list"], title=Msg.STR["ren_err"]) + MessageDialog( + "info", Msg.STR["sel_list"], title=Msg.STR["ren_err"]) except EOFError as e: - logging.error(e, exc_info=True) + logging.error(e) def handle_tunnel_data(self, active=None, data=None) -> None: """Processes tunnel data from an active connection and updates @@ -1113,11 +1132,13 @@ class FrameWidgets(ttk.Frame): if self.list_box.size() != 0: - MessageDialog("info", Msg.STR["sel_list"], title=Msg.STR["sel_tl"]) + MessageDialog( + "info", Msg.STR["sel_list"], title=Msg.STR["sel_tl"]) else: - MessageDialog("info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"]) + MessageDialog( + "info", Msg.STR["tl_first"], title=Msg.STR["sel_tl"]) def handle_connection_state(self, action: str, tunnel_name: str = None) -> None: """ @@ -1138,8 +1159,7 @@ class FrameWidgets(ttk.Frame): if process.stderr: logging.error( - f"{process.stderr} Code: {process.returncode}", exc_info=True - ) + f"{process.stderr} Code: {process.returncode}") self.update_connection_display() self.reset_fields() @@ -1157,8 +1177,7 @@ class FrameWidgets(ttk.Frame): if process.stderr: logging.error( - f"{process.stderr} Code: {process.returncode}", exc_info=True - ) + f"{process.stderr} Code: {process.returncode}") self.update_connection_display() self.handle_tunnel_data(self.a, self.tl) @@ -1187,7 +1206,6 @@ class FrameWidgets(ttk.Frame): if __name__ == "__main__": AppConfig.ensure_directories() AppConfig.create_default_settings() - _ = AppConfig.setup_translations() LxTools.sigi(AppConfig.TEMP_DIR) CryptoUtil.decrypt(getpass.getuser()) window = Wirepy() diff --git a/wp_app_config.py b/wp_app_config.py index 83e76fc..2dc4a48 100755 --- a/wp_app_config.py +++ b/wp_app_config.py @@ -1,13 +1,10 @@ #!/usr/bin/python3 """App configuration for Wire-Py""" import logging -import gettext -import locale -import tkinter as tk -import os from pathlib import Path from subprocess import CompletedProcess, run from typing import Dict, Any +from shared_libs.common_tools import Translate class AppConfig: @@ -35,10 +32,6 @@ class AppConfig: Path(LOG_DIR).mkdir(parents=True, exist_ok=True) LOG_FILE_PATH = LOG_DIR / "wirepy.log" - # Localization - APP_NAME: str = "wirepy" - LOCALE_DIR: Path = Path("/usr/share/locale/") - # Base paths BASE_DIR: Path = Path.home() CONFIG_DIR: Path = BASE_DIR / ".config/wire_py" @@ -65,7 +58,7 @@ class AppConfig: # UI configuration UI_CONFIG: Dict[str, Any] = { - "window_title": "", + "window_title": "WirePy", "window_title2": "LogViewer", "window_size": (590, 460), "font_family": "Ubuntu", @@ -81,20 +74,6 @@ class AppConfig: "pkey_path": "/usr/local/etc/ssl/pwgk.pem", } - @staticmethod - def setup_translations() -> gettext.gettext: - """ - Initialize translations and set the translation function - Special method for translating strings in this file - - Returns: - The gettext translation function - """ - locale.bindtextdomain(AppConfig.APP_NAME, AppConfig.LOCALE_DIR) - gettext.bindtextdomain(AppConfig.APP_NAME, AppConfig.LOCALE_DIR) - gettext.textdomain(AppConfig.APP_NAME) - return gettext.gettext - @classmethod def ensure_directories(cls) -> None: """Ensures that all required directories exist""" @@ -142,10 +121,11 @@ class AppConfig: check=False, ) if process.returncode == 0: - logging.info(process.stdout, exc_info=True) + logging.info(process.stdout) if process.stderr: - logging.error(f"{process.stderr} Code: {process.returncode}", exc_info=True) + logging.error( + f"{process.stderr}") @classmethod def ensure_log(cls) -> None: @@ -155,66 +135,7 @@ class AppConfig: # here is initializing the class for translation strings -_ = AppConfig.setup_translations() - - -class Image: - def __init__(self): - self.images = {} - - def load_image(self, image_key, fallback_paths=None) -> None | tk.PhotoImage: - """Load PNG image using tk.PhotoImage with fallback options""" - if image_key in self.images: - return self.images[image_key] - - # Define image paths based on key - image_paths = { - "icon_header": [ - "/usr/share/icons/lx-icons/32/wg_vpn.png", - ], - "icon_vpn": [ - "/usr/share/icons/lx-icons/48/wg_vpn.png", - ], - "icon_start": [ - "/usr/share/icons/lx-icons/48/wg_vpn-start.png", - ], - "icon_stop": [ - "/usr/share/icons/lx-icons/48/wg_vpn-stop.png", - ], - "icon_import": [ - "/usr/share/icons/lx-icons/48/wg_import.png", - ], - "icon_export": [ - "/usr/share/icons/lx-icons/48/wg_export.png", - ], - "icon_trash": [ - "/usr/share/icons/lx-icons/48/wg_trash.png", - ], - "update": [ - "/usr/share/icons/lx-icons/16/settings.png", - ], - } - - # Get paths to try - paths_to_try = image_paths.get(image_key, []) - - # Add fallback paths if provided - if fallback_paths: - paths_to_try.extend(fallback_paths) - - # Try to load image from paths - for path in paths_to_try: - try: - if os.path.exists(path): - photo = tk.PhotoImage(file=path) - self.images[image_key] = photo - return photo - except tk.TclError as e: - print(f"Fail to load image {path}: {e}") - continue - - # Return None if no image found - return None +_ = Translate.setup_translations("wirepy") class Msg: @@ -269,6 +190,33 @@ class Msg: "invalid_base64": _( "Invalid base64 format!\nPlease use a Config file with valid key." ), + "options": _("Options"), + "disable_updates": _("Disable Updates"), + "about": _("About"), + "lx_tools": _("Lx Tools Wire-Py"), + "tunnels": _("Tunnels"), + "active_tunnel": _("Active Tunnel"), + "interface": _("Interface"), + "peer": _("Peer"), + "rename": _("Rename"), + "max_chars": _("Max. 12 characters!"), + "autoconnect_on": _("Autoconnect on:"), + "no_autoconnect": _("no Autoconnect"), + "update_search_off": _("Update search off"), + "no_server_connection": _("No Server Connection!"), + "no_updates": _("No Updates"), + "about_msg": _( + "Wire-Py a simple Wireguard Gui for Linux systems.\n\n" + "Wire-Py is open source software written in Python.\n\n" + "Email: polunga40@unity-mail.de also likes for donation.\n\n" + "Use without warranty!\n" + ), + "goto_git": _("Go to Wire-Py git"), + "info": _("Info"), + "disable_tooltips": _("Disable Tooltips"), + "enable_tooltips": _("Enable Tooltips"), + "dark": _("Dark"), + "light": _("Light"), } TTIP: Dict[str, str] = { # Strings for Tooltips @@ -295,4 +243,8 @@ class Msg: "To use the autostart, a tunnel must be selected from the list" ), "download": _("Click to download new version"), - } + "updates_disabled": _("Updates you have disabled"), + "no_server_conn_tt": _("Could not connect to update server"), + "up_to_date": _("Congratulations! Wire-Py is up to date"), + "install_new_version": _("Click to install new version"), + } \ No newline at end of file