commit 10
This commit is contained in:
Binary file not shown.
@@ -24,7 +24,7 @@ class AppConfig:
|
||||
|
||||
# --- UI Configuration ---
|
||||
UI_CONFIG: Dict[str, Any] = {
|
||||
"window_title": "PyImage Backup",
|
||||
"window_title": "Pybackup",
|
||||
"window_size": "1200x800",
|
||||
"font_family": "Ubuntu",
|
||||
"font_size": 11,
|
||||
@@ -103,7 +103,6 @@ class AppConfig:
|
||||
# Generate/update the final exclude list on every start
|
||||
cls.generate_and_write_final_exclude_list()
|
||||
|
||||
|
||||
@classmethod
|
||||
def generate_and_write_final_exclude_list(cls) -> None:
|
||||
"""
|
||||
@@ -115,7 +114,7 @@ class AppConfig:
|
||||
with open(cls.GENERATED_EXCLUDE_LIST_PATH, 'w') as f:
|
||||
f.write(cls.STANDARD_EXCLUDE_CONTENT)
|
||||
except IOError as e:
|
||||
pass # Handle error in caller
|
||||
pass # Handle error in caller
|
||||
|
||||
|
||||
# --- Translation Setup ---
|
||||
@@ -139,8 +138,7 @@ class Msg:
|
||||
}
|
||||
STR: Dict[str, str] = {
|
||||
# General
|
||||
"app_title": _("PyImage Backup"),
|
||||
"welcome_title": _("Willkommen bei PyImage Backup!"),
|
||||
"app_title": _("Lx Tools Pybackup"),
|
||||
"welcome_msg": _("Bitte wählen Sie eine Aktion aus dem Menü."),
|
||||
"app_started": _("Anwendung erfolgreich gestartet."),
|
||||
"app_quit": _("Anwendung wird beendet."),
|
||||
@@ -208,6 +206,6 @@ class Msg:
|
||||
"freq_monthly": _("Monatlich"),
|
||||
"save": _("Speichern"),
|
||||
"projected_usage_label": _("Speicherverbrauch ca. nach dem Backup"),
|
||||
"header_title": _("PyImage Backup"),
|
||||
"header_subtitle": _("Ein einfaches Backup-Tool mit rsync"),
|
||||
"header_title": _("Lx Tools Py-Backup"),
|
||||
"header_subtitle": _("Simple GUI for rsync"),
|
||||
}
|
||||
|
||||
641
light.tcl
Normal file
641
light.tcl
Normal file
@@ -0,0 +1,641 @@
|
||||
# Copyright (c) 2021 rdbende <rdbende@gmail.com>
|
||||
|
||||
# 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# NEW: Sidebar Hover Button Style
|
||||
ttk::style configure SidebarHover.TButton.Borderless.Round -padding 0 -width -10 -anchor center
|
||||
ttk::style element create SidebarHover.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(button-borderless-hover2) \
|
||||
] -border 4 -sticky ewns
|
||||
ttk::style layout SidebarHover.TButton.Borderless.Round {
|
||||
SidebarHover.TButton.Borderless.Round.button -children {
|
||||
Button.padding -expand true -sticky nswe -children {
|
||||
Button.label -side left -expand true -sticky nswe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# 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
|
||||
}
|
||||
}
|
||||
41
main_app.py
41
main_app.py
@@ -26,7 +26,7 @@ class MainApplication(tk.Tk):
|
||||
|
||||
AppConfig.ensure_directories()
|
||||
|
||||
self.title("PyImage Backup")
|
||||
self.title("Py-Backup")
|
||||
self.geometry("1000x800")
|
||||
|
||||
self.style = ttk.Style()
|
||||
@@ -34,11 +34,13 @@ class MainApplication(tk.Tk):
|
||||
self.tk.call("set_theme", "light")
|
||||
self.style.configure("Custom.TFrame", background="#2b3e4f")
|
||||
self.style.configure("Sidebar.TButton", background="#2b3e4f",
|
||||
foreground="white", font=("Helvetica", 12, "bold"))
|
||||
self.style.map("Sidebar.TButton", background=[
|
||||
("active", "#3a526a")], foreground=[("active", "white")])
|
||||
foreground="white", font=("Ubuntu", 12, "bold"))
|
||||
self.style.layout("Sidebar.TButton", self.style.layout(
|
||||
"TButton.Borderless.Round"))
|
||||
"SidebarHover.TButton.Borderless.Round"))
|
||||
|
||||
# Konfiguriere den active Zustand direkt für den Basis-Style
|
||||
self.style.map("TButton.Borderless.Round", background=[
|
||||
("active", "#000000")], foreground=[("active", "black")])
|
||||
|
||||
self.style.layout("Gray.TButton.Borderless",
|
||||
self.style.layout("TButton.Borderless.Round"))
|
||||
@@ -50,7 +52,7 @@ class MainApplication(tk.Tk):
|
||||
self.grid_rowconfigure(0, weight=1)
|
||||
self.grid_columnconfigure(0, weight=1)
|
||||
|
||||
sidebar = ttk.Frame(main_frame, width=200, style="Custom.TFrame")
|
||||
sidebar = ttk.Frame(main_frame, style="Custom.TFrame")
|
||||
sidebar.grid(row=0, column=0, sticky="nsew")
|
||||
main_frame.grid_rowconfigure(0, weight=1)
|
||||
main_frame.grid_columnconfigure(0, weight=0)
|
||||
@@ -86,6 +88,13 @@ class MainApplication(tk.Tk):
|
||||
self.right_canvas_data = {}
|
||||
|
||||
# --- Sidebar ---
|
||||
# Add the lx_backup_large icon
|
||||
lx_backup_icon = self.image_manager.get_icon('lx_backup_large')
|
||||
lx_backup_label = ttk.Label(
|
||||
sidebar, image=lx_backup_icon, background="#2b3e4f")
|
||||
lx_backup_label.image = lx_backup_icon # Keep a reference
|
||||
lx_backup_label.pack(pady=10)
|
||||
|
||||
sidebar_buttons_frame = ttk.Frame(sidebar, style="Custom.TFrame")
|
||||
sidebar_buttons_frame.pack(pady=20)
|
||||
|
||||
@@ -100,17 +109,15 @@ class MainApplication(tk.Tk):
|
||||
for text, data in self.buttons_map.items():
|
||||
button = ttk.Button(sidebar_buttons_frame, text=text, style="Sidebar.TButton",
|
||||
command=lambda t=text: self.actions.on_sidebar_button_click(t))
|
||||
button.pack(fill=tk.X, padx=10, pady=5)
|
||||
button.pack(fill=tk.X, pady=10)
|
||||
|
||||
schedule_dialog_button = ttk.Button(
|
||||
sidebar_buttons_frame, text="Zeitplanung", command=lambda: self.navigation.toggle_scheduler_frame(3), style="Sidebar.TButton")
|
||||
schedule_dialog_button.pack(fill=tk.X, padx=10, pady=5)
|
||||
|
||||
|
||||
schedule_dialog_button.pack(fill=tk.X, pady=10)
|
||||
|
||||
settings_button = ttk.Button(
|
||||
sidebar_buttons_frame, text="Einstellungen", command=lambda: self.navigation.toggle_settings_frame(4), style="Sidebar.TButton")
|
||||
settings_button.pack(fill=tk.X, padx=10, pady=5)
|
||||
settings_button.pack(fill=tk.X, pady=10)
|
||||
|
||||
# --- Header ---
|
||||
self.header_frame = HeaderFrame(self.content_frame, self.image_manager)
|
||||
@@ -164,19 +171,20 @@ class MainApplication(tk.Tk):
|
||||
self.left_canvas.bind("<Configure>", self.drawing.redraw_left_canvas)
|
||||
|
||||
button_frame = ttk.Frame(self.canvas_frame)
|
||||
button_frame.grid(row=0, column=1, padx=30)
|
||||
button_frame.grid(row=0, column=1, padx=15)
|
||||
|
||||
self.mode_button_icon = self.image_manager.get_icon(
|
||||
"forward_extralarge")
|
||||
self.mode_button = ttk.Button(
|
||||
button_frame, image=self.mode_button_icon, command=self.navigation.toggle_mode, style="TButton.Borderless.Round")
|
||||
self.mode_button.pack(pady=60)
|
||||
self.mode_button.pack(pady=30)
|
||||
|
||||
self.right_canvas = tk.Canvas(
|
||||
self.canvas_frame, relief="solid", borderwidth=1)
|
||||
self.right_canvas.grid(row=0, column=2, sticky="nsew", padx=5, pady=5)
|
||||
self.right_canvas.bind("<Configure>", self.drawing.redraw_right_canvas)
|
||||
self.right_canvas.bind("<Button-1>", self.actions.on_right_canvas_click)
|
||||
self.right_canvas.bind(
|
||||
"<Button-1>", self.actions.on_right_canvas_click)
|
||||
|
||||
self.right_canvas_data = {
|
||||
'icon': 'hdd_extralarge',
|
||||
@@ -255,7 +263,8 @@ class MainApplication(tk.Tk):
|
||||
self.scheduler_frame.grid_remove()
|
||||
|
||||
def _setup_settings_frame(self):
|
||||
self.settings_frame = SettingsFrame(self.content_frame, self.navigation, self.actions, padding=10)
|
||||
self.settings_frame = SettingsFrame(
|
||||
self.content_frame, self.navigation, self.actions, padding=10)
|
||||
self.settings_frame.grid(row=2, column=0, sticky="nsew")
|
||||
self.settings_frame.grid_remove()
|
||||
|
||||
@@ -335,4 +344,4 @@ if __name__ == "__main__":
|
||||
|
||||
else:
|
||||
app = MainApplication()
|
||||
app.mainloop()
|
||||
app.mainloop()
|
||||
|
||||
Reference in New Issue
Block a user