diff --git a/gui.py b/gui.py index 4804b4a..419868c 100755 --- a/gui.py +++ b/gui.py @@ -9,7 +9,7 @@ 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, default=False): """Erstellt einen Button im nativen macOS-Stil (Aqua Theme)""" global _style_configured # Style nur einmal konfigurieren @@ -20,13 +20,19 @@ def create_macos_button(parent, text, command=None, width=None, height=None, pad style.theme_use('aqua') # macOS natives Theme except: pass # Falls aqua nicht verfügbar ist, verwende Standard - style.configure('TButton', font=('Helvetica', 13)) + # Konfiguriere Button-Style für natives macOS-Aussehen + style.configure('TButton', font=('Helvetica', 13), padding=(10, 6)) _style_configured = True # 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) if width: btn.config(width=width) + + # Auf macOS werden Buttons automatisch im nativen Stil dargestellt + # Primäre Buttons erscheinen blau, sekundäre grau + return btn class SettingsDialog: @@ -60,8 +66,8 @@ class SettingsDialog: self.load_config() # Laden der aktuellen Konfiguration - # Speichern-Button (macOS-Style) - ausgewogene Größe - save_btn = create_macos_button(self.top, text="Speichern", command=self.save_config, width=16) + # Speichern-Button (macOS-Style) - primärer Button (blau) + 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) def toggle_password_visibility(self): @@ -137,11 +143,11 @@ class GUI: self.button_frame = tk.Frame(self.root) self.button_frame.pack(side=tk.BOTTOM, fill=tk.X, pady=12) - # Durchsuchen Button (macOS-Style) - ausgewogene Größe - self.browse_button = create_macos_button(self.button_frame, text="Durchsuchen", command=self.browse, width=14) + # Durchsuchen Button (macOS-Style) - primärer Button (blau) + 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) - # 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.pack(side=tk.RIGHT, padx=12, expand=True, pady=4) @@ -413,15 +419,18 @@ class JaAbbruchDialog(tk.Toplevel): btn_frame = tk.Frame(main_frame) 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", - command=self.on_yes, width=28) + command=self.on_yes, width=28, default=True) 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", command=self.on_no, width=28) no_btn.pack(side=tk.LEFT, padx=10, pady=6) + # Sekundärer Button (grau) cancel_btn = create_macos_button(btn_frame, text="Abbruch", command=self.on_cancel, width=20) cancel_btn.pack(side=tk.LEFT, padx=10, pady=6) @@ -560,15 +569,18 @@ class ConfirmKeepOriginalDialog(tk.Toplevel): btn_frame = tk.Frame(main_frame) btn_frame.pack(pady=12) - # Buttons (macOS-Style) - ausgewogene Größe + # Buttons (macOS-Style) + # Primärer Button (blau) - empfohlene Aktion tomedo_btn = create_macos_button(btn_frame, text="Tomedo-Daten verwenden", - command=self.on_use_tomedo, width=26) + command=self.on_use_tomedo, width=26, default=True) tomedo_btn.pack(side=tk.LEFT, padx=8, pady=6) + # Sekundärer Button (grau) keep_btn = create_macos_button(btn_frame, text="Original behalten", command=self.on_keep_original, width=22) keep_btn.pack(side=tk.LEFT, padx=8, pady=6) + # Sekundärer Button (grau) cancel_btn = create_macos_button(btn_frame, text="Abbruch", command=self.on_cancel, width=18) cancel_btn.pack(side=tk.LEFT, padx=8, pady=6) @@ -645,13 +657,16 @@ class JaNeinAbbruchDialog(tk.Toplevel): btn_frame = tk.Frame(self) btn_frame.pack(pady=12) - # Buttons (macOS-Style) - ausgewogene Größe - ja_btn = create_macos_button(btn_frame, text="Ja", command=self.on_ja, width=16) + # Buttons (macOS-Style) + # Primärer Button (blau) - Ja ist die primäre Aktion + ja_btn = create_macos_button(btn_frame, text="Ja", command=self.on_ja, width=16, default=True) ja_btn.pack(side=tk.LEFT, padx=10, pady=6) + # Sekundärer Button (grau) 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) + # Sekundärer Button (grau) 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)