Alle Buttons auf macOS-Style (ttk.Button) umgestellt
This commit is contained in:
56
gui.py
56
gui.py
@@ -6,6 +6,14 @@ import os
|
|||||||
from queue import Queue
|
from queue import Queue
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
def create_macos_button(parent, text, command=None, width=None, height=None, padx=10, pady=5):
|
||||||
|
"""Erstellt einen Button im macOS-Stil"""
|
||||||
|
# Verwende ttk.Button für besseres macOS-Aussehen
|
||||||
|
btn = ttk.Button(parent, text=text, command=command)
|
||||||
|
if width:
|
||||||
|
btn.config(width=width)
|
||||||
|
return btn
|
||||||
|
|
||||||
class SettingsDialog:
|
class SettingsDialog:
|
||||||
def __init__(self, parent, config):
|
def __init__(self, parent, config):
|
||||||
self.config = config
|
self.config = config
|
||||||
@@ -37,8 +45,9 @@ class SettingsDialog:
|
|||||||
|
|
||||||
self.load_config() # Laden der aktuellen Konfiguration
|
self.load_config() # Laden der aktuellen Konfiguration
|
||||||
|
|
||||||
# Speichern-Button
|
# Speichern-Button (macOS-Style)
|
||||||
Button(self.top, text="Speichern", command=self.save_config).grid(row=4, column=1, pady=10)
|
save_btn = create_macos_button(self.top, text="Speichern", command=self.save_config)
|
||||||
|
save_btn.grid(row=4, column=1, pady=10)
|
||||||
|
|
||||||
def toggle_password_visibility(self):
|
def toggle_password_visibility(self):
|
||||||
"""Wechselt die Sichtbarkeit des Passworteingabefelds."""
|
"""Wechselt die Sichtbarkeit des Passworteingabefelds."""
|
||||||
@@ -113,12 +122,12 @@ 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=10)
|
self.button_frame.pack(side=tk.BOTTOM, fill=tk.X, pady=10)
|
||||||
|
|
||||||
# Durchsuchen Button
|
# Durchsuchen Button (macOS-Style)
|
||||||
self.browse_button = tk.Button(self.button_frame, text="Durchsuchen", command=self.browse)
|
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)
|
self.browse_button.pack(side=tk.LEFT, padx=10, expand=True)
|
||||||
|
|
||||||
# Schließen Button
|
# Schließen Button (macOS-Style)
|
||||||
self.close_button = tk.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)
|
||||||
self.close_button.pack(side=tk.RIGHT, padx=10, expand=True)
|
self.close_button.pack(side=tk.RIGHT, padx=10, expand=True)
|
||||||
|
|
||||||
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!")
|
||||||
@@ -389,17 +398,17 @@ class JaAbbruchDialog(tk.Toplevel):
|
|||||||
btn_frame = tk.Frame(main_frame)
|
btn_frame = tk.Frame(main_frame)
|
||||||
btn_frame.pack(pady=15)
|
btn_frame.pack(pady=15)
|
||||||
|
|
||||||
# Standard macOS Buttons (ohne spezielle Farben) - größer
|
# Standard macOS Buttons (ttk.Button für besseres macOS-Aussehen)
|
||||||
yes_btn = tk.Button(btn_frame, text="Tomedo-Daten übernehmen",
|
yes_btn = create_macos_button(btn_frame, text="Tomedo-Daten übernehmen",
|
||||||
command=self.on_yes, width=25, height=2)
|
command=self.on_yes, width=25)
|
||||||
yes_btn.pack(side=tk.LEFT, padx=10)
|
yes_btn.pack(side=tk.LEFT, padx=10)
|
||||||
|
|
||||||
no_btn = tk.Button(btn_frame, text="Original-Daten behalten",
|
no_btn = create_macos_button(btn_frame, text="Original-Daten behalten",
|
||||||
command=self.on_no, width=25, height=2)
|
command=self.on_no, width=25)
|
||||||
no_btn.pack(side=tk.LEFT, padx=10)
|
no_btn.pack(side=tk.LEFT, padx=10)
|
||||||
|
|
||||||
cancel_btn = tk.Button(btn_frame, text="Abbruch",
|
cancel_btn = create_macos_button(btn_frame, text="Abbruch",
|
||||||
command=self.on_cancel, width=18, height=2)
|
command=self.on_cancel, width=18)
|
||||||
cancel_btn.pack(side=tk.LEFT, padx=10)
|
cancel_btn.pack(side=tk.LEFT, padx=10)
|
||||||
|
|
||||||
self.center_window()
|
self.center_window()
|
||||||
@@ -536,17 +545,17 @@ class ConfirmKeepOriginalDialog(tk.Toplevel):
|
|||||||
btn_frame = tk.Frame(main_frame)
|
btn_frame = tk.Frame(main_frame)
|
||||||
btn_frame.pack(pady=10)
|
btn_frame.pack(pady=10)
|
||||||
|
|
||||||
# Buttons
|
# Buttons (macOS-Style)
|
||||||
tomedo_btn = tk.Button(btn_frame, text="Tomedo-Daten verwenden",
|
tomedo_btn = create_macos_button(btn_frame, text="Tomedo-Daten verwenden",
|
||||||
command=self.on_use_tomedo, width=22, height=2)
|
command=self.on_use_tomedo, width=22)
|
||||||
tomedo_btn.pack(side=tk.LEFT, padx=8)
|
tomedo_btn.pack(side=tk.LEFT, padx=8)
|
||||||
|
|
||||||
keep_btn = tk.Button(btn_frame, text="Original behalten",
|
keep_btn = create_macos_button(btn_frame, text="Original behalten",
|
||||||
command=self.on_keep_original, width=18, height=2)
|
command=self.on_keep_original, width=18)
|
||||||
keep_btn.pack(side=tk.LEFT, padx=8)
|
keep_btn.pack(side=tk.LEFT, padx=8)
|
||||||
|
|
||||||
cancel_btn = tk.Button(btn_frame, text="Abbruch",
|
cancel_btn = create_macos_button(btn_frame, text="Abbruch",
|
||||||
command=self.on_cancel, width=15, height=2)
|
command=self.on_cancel, width=15)
|
||||||
cancel_btn.pack(side=tk.LEFT, padx=8)
|
cancel_btn.pack(side=tk.LEFT, padx=8)
|
||||||
|
|
||||||
self.center_window()
|
self.center_window()
|
||||||
@@ -621,13 +630,14 @@ class JaNeinAbbruchDialog(tk.Toplevel):
|
|||||||
btn_frame = tk.Frame(self)
|
btn_frame = tk.Frame(self)
|
||||||
btn_frame.pack(pady=10)
|
btn_frame.pack(pady=10)
|
||||||
|
|
||||||
ja_btn = tk.Button(btn_frame, text="Ja", command=self.on_ja)
|
# 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)
|
ja_btn.pack(side=tk.LEFT, padx=10, pady=20)
|
||||||
|
|
||||||
nein_btn = tk.Button(btn_frame, text="Nein", command=self.on_nein)
|
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.pack(side=tk.LEFT, padx=10, pady=20)
|
||||||
|
|
||||||
abbruch_btn = tk.Button(btn_frame, text="Abbruch", command=self.on_abbruch)
|
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.pack(side=tk.LEFT, padx=10, pady=20)
|
||||||
|
|
||||||
self.center_window()
|
self.center_window()
|
||||||
|
|||||||
Reference in New Issue
Block a user