Compare commits

..

2 Commits

84
gui.py
View File

@@ -6,8 +6,18 @@ import os
from queue import Queue
import subprocess
# Style einmalig konfigurieren (wird beim ersten Import ausgeführt)
_style_configured = False
def create_macos_button(parent, text, command=None, width=None, height=None, padx=10, pady=5):
"""Erstellt einen Button im macOS-Stil"""
"""Erstellt einen Button im macOS-Stil mit größerer, lesbarerer Darstellung"""
global _style_configured
# Style nur einmal konfigurieren
if not _style_configured:
style = ttk.Style()
style.configure('TButton', font=('Helvetica', 13))
_style_configured = True
# Verwende ttk.Button für besseres macOS-Aussehen
btn = ttk.Button(parent, text=text, command=command)
if width:
@@ -45,9 +55,9 @@ class SettingsDialog:
self.load_config() # Laden der aktuellen Konfiguration
# Speichern-Button (macOS-Style)
save_btn = create_macos_button(self.top, text="Speichern", command=self.save_config)
save_btn.grid(row=4, column=1, pady=10)
# Speichern-Button (macOS-Style) - ausgewogene Größe
save_btn = create_macos_button(self.top, text="Speichern", command=self.save_config, width=16)
save_btn.grid(row=4, column=1, pady=12, padx=5)
def toggle_password_visibility(self):
"""Wechselt die Sichtbarkeit des Passworteingabefelds."""
@@ -106,8 +116,8 @@ class GUI:
self.bind_shortcuts()
# Fenstergröße und -position festlegen
window_width = 350
window_height = 150
window_width = 420
window_height = 180
screen_width = self.root.winfo_screenwidth()
screen_height = self.root.winfo_screenheight()
center_x = int(screen_width / 2 - window_width / 2)
@@ -120,15 +130,15 @@ class GUI:
# Frame für die Buttons am unteren Rand des Fensters
self.button_frame = tk.Frame(self.root)
self.button_frame.pack(side=tk.BOTTOM, fill=tk.X, pady=10)
self.button_frame.pack(side=tk.BOTTOM, fill=tk.X, pady=12)
# Durchsuchen Button (macOS-Style)
self.browse_button = create_macos_button(self.button_frame, text="Durchsuchen", command=self.browse)
self.browse_button.pack(side=tk.LEFT, padx=10, expand=True)
# Durchsuchen Button (macOS-Style) - ausgewogene Größe
self.browse_button = create_macos_button(self.button_frame, text="Durchsuchen", command=self.browse, width=14)
self.browse_button.pack(side=tk.LEFT, padx=12, expand=True, pady=4)
# Schließen Button (macOS-Style)
self.close_button = create_macos_button(self.button_frame, text="Abbruch", command=self.on_app_close)
self.close_button.pack(side=tk.RIGHT, padx=10, expand=True)
# Schließen Button (macOS-Style) - ausgewogene Größe
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.hint_label = tk.Label(self.root, text="Bitte wählen Sie den Ordner mit den Bilddaten aus!")
self.hint_label.pack(pady=5) # Pady hinzugefügt für etwas Abstand nach oben und unten
@@ -396,20 +406,20 @@ class JaAbbruchDialog(tk.Toplevel):
# Button-Frame mit besserem Layout - Standard macOS Buttons
btn_frame = tk.Frame(main_frame)
btn_frame.pack(pady=15)
btn_frame.pack(pady=18)
# Standard macOS Buttons (ttk.Button für besseres macOS-Aussehen) - breiter für bessere Lesbarkeit
# Standard macOS Buttons (ttk.Button für besseres macOS-Aussehen) - ausgewogene Größe
yes_btn = create_macos_button(btn_frame, text="Tomedo-Daten übernehmen",
command=self.on_yes, width=30)
yes_btn.pack(side=tk.LEFT, padx=10)
command=self.on_yes, width=28)
yes_btn.pack(side=tk.LEFT, padx=10, pady=6)
no_btn = create_macos_button(btn_frame, text="Original-Daten behalten",
command=self.on_no, width=30)
no_btn.pack(side=tk.LEFT, padx=10)
command=self.on_no, width=28)
no_btn.pack(side=tk.LEFT, padx=10, pady=6)
cancel_btn = create_macos_button(btn_frame, text="Abbruch",
command=self.on_cancel, width=20)
cancel_btn.pack(side=tk.LEFT, padx=10)
cancel_btn.pack(side=tk.LEFT, padx=10, pady=6)
self.center_window()
@@ -543,20 +553,20 @@ class ConfirmKeepOriginalDialog(tk.Toplevel):
# Button-Frame
btn_frame = tk.Frame(main_frame)
btn_frame.pack(pady=10)
btn_frame.pack(pady=12)
# Buttons (macOS-Style) - breiter für bessere Lesbarkeit
# Buttons (macOS-Style) - ausgewogene Größe
tomedo_btn = create_macos_button(btn_frame, text="Tomedo-Daten verwenden",
command=self.on_use_tomedo, width=28)
tomedo_btn.pack(side=tk.LEFT, padx=8)
command=self.on_use_tomedo, width=26)
tomedo_btn.pack(side=tk.LEFT, padx=8, pady=6)
keep_btn = create_macos_button(btn_frame, text="Original behalten",
command=self.on_keep_original, width=24)
keep_btn.pack(side=tk.LEFT, padx=8)
command=self.on_keep_original, width=22)
keep_btn.pack(side=tk.LEFT, padx=8, pady=6)
cancel_btn = create_macos_button(btn_frame, text="Abbruch",
command=self.on_cancel, width=18)
cancel_btn.pack(side=tk.LEFT, padx=8)
cancel_btn.pack(side=tk.LEFT, padx=8, pady=6)
self.center_window()
@@ -624,21 +634,21 @@ class JaNeinAbbruchDialog(tk.Toplevel):
self.title(title)
self.geometry("400x175") # Größe des Dialogs
tk.Label(self, text=self.message).pack(pady=20)
self.geometry("420x180") # Angepasste Fenstergröße
tk.Label(self, text=self.message, font=('Helvetica', 13)).pack(pady=20)
btn_frame = tk.Frame(self)
btn_frame.pack(pady=10)
btn_frame.pack(pady=12)
# Buttons (macOS-Style)
ja_btn = create_macos_button(btn_frame, text="Ja", command=self.on_ja)
ja_btn.pack(side=tk.LEFT, padx=10, pady=20)
# Buttons (macOS-Style) - ausgewogene Größe
ja_btn = create_macos_button(btn_frame, text="Ja", command=self.on_ja, width=16)
ja_btn.pack(side=tk.LEFT, padx=10, pady=6)
nein_btn = create_macos_button(btn_frame, text="Nein", command=self.on_nein)
nein_btn.pack(side=tk.LEFT, padx=10, pady=20)
nein_btn = create_macos_button(btn_frame, text="Nein", command=self.on_nein, width=16)
nein_btn.pack(side=tk.LEFT, padx=10, pady=6)
abbruch_btn = create_macos_button(btn_frame, text="Abbruch", command=self.on_abbruch)
abbruch_btn.pack(side=tk.LEFT, padx=10, pady=20)
abbruch_btn = create_macos_button(btn_frame, text="Abbruch", command=self.on_abbruch, width=16)
abbruch_btn.pack(side=tk.LEFT, padx=10, pady=6)
self.center_window()