Compare commits
11 Commits
c086cbd8e1
...
v1.0-gui-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc67232628 | ||
|
|
acaaba7758 | ||
|
|
ccc764f198 | ||
|
|
aa12d099ae | ||
|
|
ccf6717e92 | ||
|
|
a2ea61e0f3 | ||
|
|
b8d90481bc | ||
|
|
2b4be16317 | ||
|
|
5d76c6b020 | ||
|
|
02dfb69121 | ||
|
|
5b29837120 |
80
gui.py
80
gui.py
@@ -9,19 +9,30 @@ import subprocess
|
|||||||
# Style einmalig konfigurieren (wird beim ersten Import ausgeführt)
|
# Style einmalig konfigurieren (wird beim ersten Import ausgeführt)
|
||||||
_style_configured = False
|
_style_configured = False
|
||||||
|
|
||||||
def create_macos_button(parent, text, command=None, width=None, height=None, padx=10, pady=5):
|
def create_macos_button(parent, text, command=None, width=None, height=None, padx=10, pady=5, default=False):
|
||||||
"""Erstellt einen Button im macOS-Stil mit größerer, lesbarerer Darstellung"""
|
"""Erstellt einen Button im nativen macOS-Stil (Aqua Theme)"""
|
||||||
global _style_configured
|
global _style_configured
|
||||||
# Style nur einmal konfigurieren
|
# Style nur einmal konfigurieren
|
||||||
if not _style_configured:
|
if not _style_configured:
|
||||||
style = ttk.Style()
|
style = ttk.Style()
|
||||||
style.configure('TButton', font=('Helvetica', 13))
|
# Verwende das native macOS Aqua Theme
|
||||||
|
try:
|
||||||
|
style.theme_use('aqua') # macOS natives Theme
|
||||||
|
except:
|
||||||
|
pass # Falls aqua nicht verfügbar ist, verwende Standard
|
||||||
|
# Konfiguriere Button-Style für natives macOS-Aussehen
|
||||||
|
style.configure('TButton', font=('Helvetica', 13), padding=(10, 6))
|
||||||
_style_configured = True
|
_style_configured = True
|
||||||
|
|
||||||
# Verwende ttk.Button für besseres macOS-Aussehen
|
# Verwende ttk.Button für natives macOS-Aussehen
|
||||||
|
# Das Aqua Theme stellt primäre Buttons automatisch blau dar
|
||||||
btn = ttk.Button(parent, text=text, command=command)
|
btn = ttk.Button(parent, text=text, command=command)
|
||||||
if width:
|
if width:
|
||||||
btn.config(width=width)
|
btn.config(width=width)
|
||||||
|
|
||||||
|
# Auf macOS werden Buttons automatisch im nativen Stil dargestellt
|
||||||
|
# Primäre Buttons erscheinen blau, sekundäre grau
|
||||||
|
|
||||||
return btn
|
return btn
|
||||||
|
|
||||||
class SettingsDialog:
|
class SettingsDialog:
|
||||||
@@ -55,8 +66,8 @@ class SettingsDialog:
|
|||||||
|
|
||||||
self.load_config() # Laden der aktuellen Konfiguration
|
self.load_config() # Laden der aktuellen Konfiguration
|
||||||
|
|
||||||
# Speichern-Button (macOS-Style) - ausgewogene Größe
|
# Speichern-Button (macOS-Style) - primärer Button (blau)
|
||||||
save_btn = create_macos_button(self.top, text="Speichern", command=self.save_config, width=16)
|
save_btn = create_macos_button(self.top, text="Speichern", command=self.save_config, width=16, default=True)
|
||||||
save_btn.grid(row=4, column=1, pady=12, padx=5)
|
save_btn.grid(row=4, column=1, pady=12, padx=5)
|
||||||
|
|
||||||
def toggle_password_visibility(self):
|
def toggle_password_visibility(self):
|
||||||
@@ -132,15 +143,16 @@ class GUI:
|
|||||||
self.button_frame = tk.Frame(self.root)
|
self.button_frame = tk.Frame(self.root)
|
||||||
self.button_frame.pack(side=tk.BOTTOM, fill=tk.X, pady=12)
|
self.button_frame.pack(side=tk.BOTTOM, fill=tk.X, pady=12)
|
||||||
|
|
||||||
# Durchsuchen Button (macOS-Style) - ausgewogene Größe
|
# Durchsuchen Button (macOS-Style) - primärer Standard-Button (blau)
|
||||||
self.browse_button = create_macos_button(self.button_frame, text="Durchsuchen", command=self.browse, width=14)
|
self.browse_button = create_macos_button(self.button_frame, text="Durchsuchen", command=self.browse, width=14, default=True)
|
||||||
self.browse_button.pack(side=tk.LEFT, padx=12, expand=True, pady=4)
|
self.browse_button.pack(side=tk.LEFT, padx=12, expand=True, pady=4)
|
||||||
|
|
||||||
# Schließen Button (macOS-Style) - ausgewogene Größe
|
# Schließen Button (macOS-Style) - sekundärer Button (grau)
|
||||||
self.close_button = create_macos_button(self.button_frame, text="Abbruch", command=self.on_app_close, width=14)
|
self.close_button = create_macos_button(self.button_frame, text="Abbruch", command=self.on_app_close, width=14)
|
||||||
self.close_button.pack(side=tk.RIGHT, padx=12, expand=True, pady=4)
|
self.close_button.pack(side=tk.RIGHT, padx=12, expand=True, pady=4)
|
||||||
|
|
||||||
self.hint_label = tk.Label(self.root, text="Bitte wählen Sie den Ordner mit den Bilddaten aus!")
|
# Hinweis-Label mit angepasster Schriftgröße (wie Buttons: 13pt)
|
||||||
|
self.hint_label = tk.Label(self.root, text="Bitte wählen Sie den Ordner mit den Bilddaten aus!", font=('Helvetica', 13))
|
||||||
self.hint_label.pack(pady=5) # Pady hinzugefügt für etwas Abstand nach oben und unten
|
self.hint_label.pack(pady=5) # Pady hinzugefügt für etwas Abstand nach oben und unten
|
||||||
|
|
||||||
self.root.protocol("WM_DELETE_WINDOW", self.on_close)
|
self.root.protocol("WM_DELETE_WINDOW", self.on_close)
|
||||||
@@ -354,8 +366,8 @@ class JaAbbruchDialog(tk.Toplevel):
|
|||||||
self.transfer_folder = transfer_folder
|
self.transfer_folder = transfer_folder
|
||||||
|
|
||||||
self.title(title)
|
self.title(title)
|
||||||
self.geometry("900x500") # Größeres Fenster für bessere Lesbarkeit
|
self.geometry("950x520") # Größeres Fenster für bessere Lesbarkeit und passende Proportionen
|
||||||
self.minsize(850, 480) # Minimale Größe erhöht
|
self.minsize(900, 500) # Minimale Größe angepasst
|
||||||
|
|
||||||
# Hauptframe für besseres Layout
|
# Hauptframe für besseres Layout
|
||||||
main_frame = tk.Frame(self)
|
main_frame = tk.Frame(self)
|
||||||
@@ -408,15 +420,18 @@ class JaAbbruchDialog(tk.Toplevel):
|
|||||||
btn_frame = tk.Frame(main_frame)
|
btn_frame = tk.Frame(main_frame)
|
||||||
btn_frame.pack(pady=18)
|
btn_frame.pack(pady=18)
|
||||||
|
|
||||||
# Standard macOS Buttons (ttk.Button für besseres macOS-Aussehen) - ausgewogene Größe
|
# Standard macOS Buttons (ttk.Button für besseres macOS-Aussehen)
|
||||||
|
# Primärer Button (blau) - empfohlene Aktion
|
||||||
yes_btn = create_macos_button(btn_frame, text="Tomedo-Daten übernehmen",
|
yes_btn = create_macos_button(btn_frame, text="Tomedo-Daten übernehmen",
|
||||||
command=self.on_yes, width=28)
|
command=self.on_yes, width=28, default=True)
|
||||||
yes_btn.pack(side=tk.LEFT, padx=10, pady=6)
|
yes_btn.pack(side=tk.LEFT, padx=10, pady=6)
|
||||||
|
|
||||||
|
# Sekundärer Button (grau)
|
||||||
no_btn = create_macos_button(btn_frame, text="Original-Daten behalten",
|
no_btn = create_macos_button(btn_frame, text="Original-Daten behalten",
|
||||||
command=self.on_no, width=28)
|
command=self.on_no, width=28)
|
||||||
no_btn.pack(side=tk.LEFT, padx=10, pady=6)
|
no_btn.pack(side=tk.LEFT, padx=10, pady=6)
|
||||||
|
|
||||||
|
# Sekundärer Button (grau)
|
||||||
cancel_btn = create_macos_button(btn_frame, text="Abbruch",
|
cancel_btn = create_macos_button(btn_frame, text="Abbruch",
|
||||||
command=self.on_cancel, width=20)
|
command=self.on_cancel, width=20)
|
||||||
cancel_btn.pack(side=tk.LEFT, padx=10, pady=6)
|
cancel_btn.pack(side=tk.LEFT, padx=10, pady=6)
|
||||||
@@ -491,8 +506,8 @@ class ConfirmKeepOriginalDialog(tk.Toplevel):
|
|||||||
self.transfer_folder = transfer_folder
|
self.transfer_folder = transfer_folder
|
||||||
|
|
||||||
self.title("Bestätigung")
|
self.title("Bestätigung")
|
||||||
self.geometry("900x620") # Größeres Fenster für vollständige Datenanzeige und bessere Lesbarkeit
|
self.geometry("1000x680") # Größeres Fenster für vollständige Datenanzeige und bessere Lesbarkeit
|
||||||
self.minsize(850, 600) # Minimale Größe erhöht
|
self.minsize(950, 650) # Minimale Größe erhöht
|
||||||
|
|
||||||
main_frame = tk.Frame(self)
|
main_frame = tk.Frame(self)
|
||||||
main_frame.pack(fill=tk.BOTH, expand=True, padx=40, pady=30)
|
main_frame.pack(fill=tk.BOTH, expand=True, padx=40, pady=30)
|
||||||
@@ -555,17 +570,20 @@ class ConfirmKeepOriginalDialog(tk.Toplevel):
|
|||||||
btn_frame = tk.Frame(main_frame)
|
btn_frame = tk.Frame(main_frame)
|
||||||
btn_frame.pack(pady=12)
|
btn_frame.pack(pady=12)
|
||||||
|
|
||||||
# Buttons (macOS-Style) - ausgewogene Größe
|
# Buttons (macOS-Style) - breiter für bessere Textlesbarkeit
|
||||||
|
# Primärer Button (blau) - empfohlene Aktion
|
||||||
tomedo_btn = create_macos_button(btn_frame, text="Tomedo-Daten verwenden",
|
tomedo_btn = create_macos_button(btn_frame, text="Tomedo-Daten verwenden",
|
||||||
command=self.on_use_tomedo, width=26)
|
command=self.on_use_tomedo, width=32, default=True)
|
||||||
tomedo_btn.pack(side=tk.LEFT, padx=8, pady=6)
|
tomedo_btn.pack(side=tk.LEFT, padx=8, pady=6)
|
||||||
|
|
||||||
|
# Sekundärer Button (grau)
|
||||||
keep_btn = create_macos_button(btn_frame, text="Original behalten",
|
keep_btn = create_macos_button(btn_frame, text="Original behalten",
|
||||||
command=self.on_keep_original, width=22)
|
command=self.on_keep_original, width=26)
|
||||||
keep_btn.pack(side=tk.LEFT, padx=8, pady=6)
|
keep_btn.pack(side=tk.LEFT, padx=8, pady=6)
|
||||||
|
|
||||||
|
# Sekundärer Button (grau)
|
||||||
cancel_btn = create_macos_button(btn_frame, text="Abbruch",
|
cancel_btn = create_macos_button(btn_frame, text="Abbruch",
|
||||||
command=self.on_cancel, width=18)
|
command=self.on_cancel, width=20)
|
||||||
cancel_btn.pack(side=tk.LEFT, padx=8, pady=6)
|
cancel_btn.pack(side=tk.LEFT, padx=8, pady=6)
|
||||||
|
|
||||||
self.center_window()
|
self.center_window()
|
||||||
@@ -634,21 +652,25 @@ class JaNeinAbbruchDialog(tk.Toplevel):
|
|||||||
|
|
||||||
self.title(title)
|
self.title(title)
|
||||||
|
|
||||||
self.geometry("420x180") # Angepasste Fenstergröße
|
self.geometry("480x190") # Kompakteres Fenster für bessere Lesbarkeit
|
||||||
tk.Label(self, text=self.message, font=('Helvetica', 13)).pack(pady=20)
|
self.minsize(450, 170) # Minimale Größe
|
||||||
|
tk.Label(self, text=self.message, font=('Helvetica', 13), wraplength=420).pack(pady=20)
|
||||||
|
|
||||||
btn_frame = tk.Frame(self)
|
btn_frame = tk.Frame(self)
|
||||||
btn_frame.pack(pady=12)
|
btn_frame.pack(pady=12)
|
||||||
|
|
||||||
# Buttons (macOS-Style) - ausgewogene Größe
|
# Buttons (macOS-Style) - minimale Breiten für bessere Lesbarkeit
|
||||||
ja_btn = create_macos_button(btn_frame, text="Ja", command=self.on_ja, width=16)
|
# Primärer Button (blau) - Ja ist die primäre Aktion
|
||||||
ja_btn.pack(side=tk.LEFT, padx=10, pady=6)
|
ja_btn = create_macos_button(btn_frame, text="Ja", command=self.on_ja, width=8, default=True)
|
||||||
|
ja_btn.pack(side=tk.LEFT, padx=8, pady=5)
|
||||||
|
|
||||||
nein_btn = create_macos_button(btn_frame, text="Nein", command=self.on_nein, width=16)
|
# Sekundärer Button (grau)
|
||||||
nein_btn.pack(side=tk.LEFT, padx=10, pady=6)
|
nein_btn = create_macos_button(btn_frame, text="Nein", command=self.on_nein, width=8)
|
||||||
|
nein_btn.pack(side=tk.LEFT, padx=8, pady=5)
|
||||||
|
|
||||||
abbruch_btn = create_macos_button(btn_frame, text="Abbruch", command=self.on_abbruch, width=16)
|
# Sekundärer Button (grau)
|
||||||
abbruch_btn.pack(side=tk.LEFT, padx=10, pady=6)
|
abbruch_btn = create_macos_button(btn_frame, text="Abbruch", command=self.on_abbruch, width=10)
|
||||||
|
abbruch_btn.pack(side=tk.LEFT, padx=8, pady=5)
|
||||||
|
|
||||||
self.center_window()
|
self.center_window()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user