Alle Buttons größer und lesbarer gemacht (Schriftgröße 13, größere Breiten, mehr Padding)

This commit is contained in:
René Mathieu
2026-01-17 14:20:50 +01:00
parent 174521cd0e
commit 1f265c0e3c

84
gui.py
View File

@@ -6,8 +6,18 @@ import os
from queue import Queue from queue import Queue
import subprocess 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): 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 # Verwende ttk.Button für besseres macOS-Aussehen
btn = ttk.Button(parent, text=text, command=command) btn = ttk.Button(parent, text=text, command=command)
if width: if width:
@@ -45,9 +55,9 @@ class SettingsDialog:
self.load_config() # Laden der aktuellen Konfiguration self.load_config() # Laden der aktuellen Konfiguration
# Speichern-Button (macOS-Style) # Speichern-Button (macOS-Style) - größer und lesbarer
save_btn = create_macos_button(self.top, text="Speichern", command=self.save_config) save_btn = create_macos_button(self.top, text="Speichern", command=self.save_config, width=20)
save_btn.grid(row=4, column=1, pady=10) save_btn.grid(row=4, column=1, pady=15, padx=5)
def toggle_password_visibility(self): def toggle_password_visibility(self):
"""Wechselt die Sichtbarkeit des Passworteingabefelds.""" """Wechselt die Sichtbarkeit des Passworteingabefelds."""
@@ -120,15 +130,15 @@ class GUI:
# Frame für die Buttons am unteren Rand des Fensters # Frame für die Buttons am unteren Rand des Fensters
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=10) self.button_frame.pack(side=tk.BOTTOM, fill=tk.X, pady=15)
# Durchsuchen Button (macOS-Style) # Durchsuchen Button (macOS-Style) - größer und lesbarer
self.browse_button = create_macos_button(self.button_frame, text="Durchsuchen", command=self.browse) self.browse_button = create_macos_button(self.button_frame, text="Durchsuchen", command=self.browse, width=18)
self.browse_button.pack(side=tk.LEFT, padx=10, expand=True) self.browse_button.pack(side=tk.LEFT, padx=15, expand=True, pady=5)
# Schließen Button (macOS-Style) # Schließen Button (macOS-Style) - größer und lesbarer
self.close_button = create_macos_button(self.button_frame, text="Abbruch", command=self.on_app_close) self.close_button = create_macos_button(self.button_frame, text="Abbruch", command=self.on_app_close, width=18)
self.close_button.pack(side=tk.RIGHT, padx=10, expand=True) self.close_button.pack(side=tk.RIGHT, padx=15, expand=True, pady=5)
self.hint_label = tk.Label(self.root, text="Bitte wählen Sie den Ordner mit den Bilddaten aus!") 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 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 # Button-Frame mit besserem Layout - Standard macOS Buttons
btn_frame = tk.Frame(main_frame) btn_frame = tk.Frame(main_frame)
btn_frame.pack(pady=15) btn_frame.pack(pady=20)
# 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) - größer und lesbarer
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=30) command=self.on_yes, width=35)
yes_btn.pack(side=tk.LEFT, padx=10) yes_btn.pack(side=tk.LEFT, padx=12, pady=8)
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=30) command=self.on_no, width=35)
no_btn.pack(side=tk.LEFT, padx=10) no_btn.pack(side=tk.LEFT, padx=12, pady=8)
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=25)
cancel_btn.pack(side=tk.LEFT, padx=10) cancel_btn.pack(side=tk.LEFT, padx=12, pady=8)
self.center_window() self.center_window()
@@ -543,20 +553,20 @@ class ConfirmKeepOriginalDialog(tk.Toplevel):
# Button-Frame # Button-Frame
btn_frame = tk.Frame(main_frame) btn_frame = tk.Frame(main_frame)
btn_frame.pack(pady=10) btn_frame.pack(pady=15)
# Buttons (macOS-Style) - breiter für bessere Lesbarkeit # Buttons (macOS-Style) - größer und lesbarer
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=28) command=self.on_use_tomedo, width=32)
tomedo_btn.pack(side=tk.LEFT, padx=8) tomedo_btn.pack(side=tk.LEFT, padx=10, pady=8)
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=24) command=self.on_keep_original, width=28)
keep_btn.pack(side=tk.LEFT, padx=8) keep_btn.pack(side=tk.LEFT, padx=10, pady=8)
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=22)
cancel_btn.pack(side=tk.LEFT, padx=8) cancel_btn.pack(side=tk.LEFT, padx=10, pady=8)
self.center_window() self.center_window()
@@ -624,21 +634,21 @@ class JaNeinAbbruchDialog(tk.Toplevel):
self.title(title) self.title(title)
self.geometry("400x175") # Größe des Dialogs self.geometry("450x200") # Größeres Fenster für bessere Lesbarkeit
tk.Label(self, text=self.message).pack(pady=20) tk.Label(self, text=self.message, font=('Helvetica', 13)).pack(pady=25)
btn_frame = tk.Frame(self) btn_frame = tk.Frame(self)
btn_frame.pack(pady=10) btn_frame.pack(pady=15)
# Buttons (macOS-Style) # Buttons (macOS-Style) - größer und lesbarer
ja_btn = create_macos_button(btn_frame, text="Ja", command=self.on_ja) ja_btn = create_macos_button(btn_frame, text="Ja", command=self.on_ja, width=20)
ja_btn.pack(side=tk.LEFT, padx=10, pady=20) ja_btn.pack(side=tk.LEFT, padx=12, pady=10)
nein_btn = create_macos_button(btn_frame, text="Nein", command=self.on_nein) nein_btn = create_macos_button(btn_frame, text="Nein", command=self.on_nein, width=20)
nein_btn.pack(side=tk.LEFT, padx=10, pady=20) nein_btn.pack(side=tk.LEFT, padx=12, pady=10)
abbruch_btn = create_macos_button(btn_frame, text="Abbruch", command=self.on_abbruch) abbruch_btn = create_macos_button(btn_frame, text="Abbruch", command=self.on_abbruch, width=20)
abbruch_btn.pack(side=tk.LEFT, padx=10, pady=20) abbruch_btn.pack(side=tk.LEFT, padx=12, pady=10)
self.center_window() self.center_window()