Änderungen Grafische Oberfläche + kleinere Änderugen Programm

This commit is contained in:
2025-08-18 12:06:07 +02:00
parent 24517f0e86
commit bea23a8483
4 changed files with 473 additions and 76 deletions
+471 -74
View File
@@ -4,7 +4,6 @@ import tkinter.ttk as ttk
from tkinter import messagebox, simpledialog
from datetime import datetime
from PIL import Image, ImageTk
from storage import lade_daten, speichere_daten, reset_daten
from export import exportiere_txt, exportiere_excel
from integra_lookup import finde_integra_nummern
@@ -33,19 +32,18 @@ class ZeitErfassungApp:
def __init__(self, root: tk.Tk):
self.root = root
self.root.title("Zeiterfassung MERZ")
self.root.geometry("900x520")
self.root.geometry("900x560")
# Fenstericon setzen (ICO bevorzugt, PNG geht auf manchen Systemen auch)
try:
icon_path = LOGO_PATH # falls dein Logo z. B. PNG ist
icon_path = LOGO_PATH
if icon_path.lower().endswith(".ico"):
self.root.iconbitmap(icon_path) # direkt .ico laden
self.root.iconbitmap(icon_path)
else:
# PNG → PhotoImage
img = Image.open(icon_path)
icon_img = ImageTk.PhotoImage(img)
self.root.iconphoto(True, icon_img)
self._icon_ref = icon_img # Referenz halten, sonst wird's gelöscht
self._icon_ref = icon_img
except Exception as e:
print(f"Fenstericon konnte nicht gesetzt werden: {e}")
@@ -55,73 +53,69 @@ class ZeitErfassungApp:
# Grundfarben (helle Palette)
self.bg_color = "#F5F5F7"
self.fg_color = "#1D1D1F"
self.root.configure(bg=self.bg_color)
# UI aufbauen
self._build_gui()
self._build_menu()
self._create_busy_overlay()
self.aktualisiere_liste()
# ↵ Enter startet den Vorgang
self.root.bind("<Return>", lambda e: self.start_vorgang())
# --------------------------- Apple-Style ------------------------------
def _apply_apple_style(self):
# Farb- & Stildefinition
self.apple_bg = "#F5F5F7" # Fensterhintergrund
self.apple_card = "#FFFFFF" # Karten/Flächen
self.apple_border = "#E5E5EA"
self.apple_text = "#1D1D1F"
self.apple_subtext = "#3A3A3C"
self.apple_blue = "#0A84FF" # Akzent
self.bg = "#F5F5F7" # Fensterhintergrund
self.card = "#FFFFFF" # Karten/Flächen
self.border = "#E5E5EA"
self.text = "#1D1D1F"
self.subtext = "#3A3A3C"
self.blue = "#0A84FF" # Akzent
self.blue_hover = "#147CFF"
self.blue_pressed = "#0068DA"
self.neutral_hover = "#F2F2F7"
style = ttk.Style()
style.theme_use("default")
# Globale Schrift
style.configure(
".",
background=self.apple_bg,
foreground=self.apple_text,
font=("Segoe UI", 11)
)
style.configure(".", background=self.bg, foreground=self.text, font=("Segoe UI", 11))
# Karten / Toolbar
style.configure("Card.TFrame", background=self.apple_card, borderwidth=1, relief="solid")
style.configure("Toolbar.TFrame", background=self.apple_bg)
style.configure("Card.TFrame", background=self.card, borderwidth=1, relief="solid")
style.configure("Toolbar.TFrame", background=self.bg)
# Labels
style.configure("TLabel", background=self.apple_bg, foreground=self.apple_text, font=("Segoe UI", 11))
style.configure("Title.TLabel", background=self.apple_bg, foreground=self.apple_text, font=("Segoe UI", 16, "bold"))
style.configure("Secondary.TLabel", background=self.apple_bg, foreground=self.apple_subtext)
style.configure("TLabel", background=self.bg, foreground=self.text, font=("Segoe UI", 11))
style.configure("Title.TLabel", background=self.bg, foreground=self.text, font=("Segoe UI", 16, "bold"))
style.configure("Secondary.TLabel", background=self.bg, foreground=self.subtext)
# Entries
style.configure("TEntry", fieldbackground=self.apple_card, background=self.apple_card, foreground=self.apple_text)
# Entry
style.configure("TEntry", fieldbackground=self.card, background=self.card, foreground=self.text)
# Buttons (neutral)
style.configure(
"TButton",
background=self.apple_card,
foreground=self.apple_text,
padding=(12, 8),
borderwidth=1,
relief="flat"
)
style.map(
"TButton",
background=[("active", "#F2F2F7")],
relief=[("pressed", "sunken")]
)
# Neutraler Button
style.configure("TButton", background=self.card, foreground=self.text, padding=(12, 8),
borderwidth=1, relief="flat")
style.map("TButton",
background=[("active", self.neutral_hover)],
relief=[("pressed", "sunken")])
# Primär-Button (blau)
style.configure(
"Accent.TButton",
background=self.apple_blue,
foreground="#FFFFFF",
padding=(14, 9),
borderwidth=0,
relief="flat"
)
style.map("Accent.TButton", background=[("active", "#147CFF")])
# Primär-Button (sichtbarere States)
style.configure("Accent.TButton", background=self.blue, foreground="#FFFFFF",
padding=(14, 9), borderwidth=0, relief="flat")
style.map("Accent.TButton",
background=[("active", self.blue_hover), ("pressed", self.blue_pressed)])
# Danger-Button (optional nutzbar)
style.configure("Danger.TButton", background="#FF3B30", foreground="white",
padding=(12, 8), borderwidth=0, relief="flat")
style.map("Danger.TButton",
background=[("active", "#FF554D"), ("pressed", "#D92A21")])
# Progressbar
style.configure("Thin.Horizontal.TProgressbar", troughcolor=self.card, background=self.blue)
# ---------------------------- GUI-Aufbau ------------------------------
@@ -138,30 +132,38 @@ class ZeitErfassungApp:
self.logo = ImageTk.PhotoImage(logo_img)
ttk.Label(toolbar, image=self.logo, style="TLabel").pack(side="left", padx=(0, 8))
except Exception:
# Falls Logo fehlt, einfach nur Text anzeigen
pass
ttk.Label(toolbar, text="Zeiterfassung", style="Title.TLabel").pack(side="left")
# Spacer
ttk.Label(toolbar, text="", style="TLabel").pack(side="left", expand=True)
# Primäraktion
ttk.Button(toolbar, text="Start", command=self.start_vorgang, style="Accent.TButton").pack(side="right")
ttk.Label(toolbar, text="", style="TLabel").pack(side="left", expand=True) # Spacer
# Hauptkarte
main_card = ttk.Frame(self.root, style="Card.TFrame")
main_card.pack(fill="both", expand=True, padx=12, pady=(0, 12))
# Eingabezeile
row = ttk.Frame(main_card, style="Card.TFrame")
row.pack(fill="x", padx=12, pady=12)
# ---------------- Eingabebereich mit schwarzem Rahmen ----------------
# Außenrahmen (schwarzer Strich) + Innenabstand
input_wrap = tk.Frame(main_card, bg=self.card, highlightthickness=2, highlightbackground="#000000")
input_wrap.pack(fill="x", padx=12, pady=(12, 8))
inner = tk.Frame(input_wrap, bg=self.card)
inner.pack(fill="x", padx=10, pady=8)
# Grid: Label | Entry (dehnbar) | Start-Button
inner.grid_columnconfigure(0, weight=0)
inner.grid_columnconfigure(1, weight=1)
inner.grid_columnconfigure(2, weight=0)
self.maschinennummer = tk.StringVar()
ttk.Label(row, text="Maschinennummer:").pack(side="left", padx=(0, 8))
ttk.Entry(row, textvariable=self.maschinennummer, width=150).pack(side="left")
# Liste + Scrollbar
ttk.Label(inner, text="Maschinennummer:").grid(row=0, column=0, sticky="w", padx=(0, 10))
self.entry = ttk.Entry(inner, textvariable=self.maschinennummer)
self.entry.grid(row=0, column=1, sticky="ew") # füllt bis rechts
self.entry.focus_set()
self.start_button_inline = ttk.Button(inner, text="Start", command=self.start_vorgang, style="Accent.TButton")
self.start_button_inline.grid(row=0, column=2, sticky="e", padx=(10, 0))
# ---------------- Liste + Scrollbar ----------------
list_frame = ttk.Frame(main_card, style="Card.TFrame")
list_frame.pack(fill="both", expand=True, padx=12, pady=(0, 12))
@@ -175,28 +177,29 @@ class ZeitErfassungApp:
activestyle="none",
borderwidth=0,
highlightthickness=0,
bg=self.apple_card,
fg=self.apple_text,
selectbackground="#D0E7FF", # leichte Blau-Hervorhebung
selectforeground=self.apple_text
bg=self.card,
fg=self.text,
selectbackground="#D0E7FF",
selectforeground=self.text
)
self.listbox.pack(side="left", fill="both", expand=True)
self.listbox.config(yscrollcommand=scrollbar.set)
scrollbar.config(command=self.listbox.yview)
# Aktionsleiste unten
# ---------------- Aktionsleiste unten ----------------
actions = ttk.Frame(main_card, style="Toolbar.TFrame")
actions.pack(fill="x", padx=12, pady=(0, 12))
ttk.Button(actions, text="Stop mit Kommentar", command=self.stoppe_auswahl).pack(side="left")
ttk.Button(actions, text="Auswahl löschen", command=self.loesche_auswahl).pack(side="left", padx=(8, 0))
ttk.Button(actions, text="Alles zurücksetzen",
command=self.reset).pack(side="left", padx=(8, 0))
ttk.Button(actions, text="Alles zurücksetzen", command=self.reset, style="Danger.TButton").pack(side="left", padx=(8, 0))
ttk.Button(actions, text="Export TXT",
command=lambda: exportiere_txt(self.vorgaenge, self.berechne_dauer_min)).pack(side="right")
command=lambda: self._with_busy(lambda: exportiere_txt(self.vorgaenge, self.berechne_dauer_min),
toast="TXT exportiert")).pack(side="right")
ttk.Button(actions, text="Export Excel",
command=lambda: exportiere_excel(self.vorgaenge, self.berechne_dauer_min)).pack(side="right", padx=(0, 8))
command=lambda: self._with_busy(lambda: exportiere_excel(self.vorgaenge, self.berechne_dauer_min),
toast="Excel exportiert")).pack(side="right", padx=(0, 8))
# ------------------------------ Menü ---------------------------------
@@ -212,7 +215,6 @@ class ZeitErfassungApp:
optionen_menu.add_command(label="Extras")
optionen_menu.add_command(label="Bearbeitungs-Excel festlegen…", command=self._set_excel_path)
optionen_menu.add_cascade(label="Darstellung", menu=darstellung_menu)
menubar.add_cascade(label="Optionen", menu=optionen_menu)
# Bearbeiten
@@ -222,8 +224,402 @@ class ZeitErfassungApp:
self.root.config(menu=menubar)
# --------------------------- Busy/Toast UI ----------------------------
def _create_busy_overlay(self):
# halbtransparente Überlagerung (vereinfachte Variante ohne echte Alpha)
self._overlay = tk.Frame(self.root, bg="#000000")
self._overlay.place_forget()
inner = tk.Frame(self._overlay, bg=self.card, highlightthickness=1, highlightbackground=self.border)
inner.place(relx=0.5, rely=0.5, anchor="center")
inner.configure(padx=20, pady=14)
lbl = tk.Label(inner, text="Bitte warten…", bg=self.card, fg=self.text, font=("Segoe UI", 11, "bold"))
lbl.pack(pady=(0, 8))
self._pbar = ttk.Progressbar(inner, mode="indeterminate", length=240, style="Thin.Horizontal.TProgressbar")
self._pbar.pack()
# Toast (kleine Meldung unten rechts)
self._toast = tk.Label(self.root, text="", bg="#222222", fg="white",
font=("Segoe UI", 10), padx=10, pady=6)
# --------------------------- Aktionen/Logik ---------------------------
def start_vorgang(self):
nummer = self.maschinennummer.get().strip()
if not nummer:
messagebox.showerror("Fehler", "Bitte Maschinennummer eingeben.")
return
# INTEGRA-Suche
bearb_num, fehler = finde_integra_nummern(nummer)
if fehler:
messagebox.showwarning("INTEGRA-Suche", fehler)
kommentar = "" # keine Bearbeitungsnummer gefunden
else:
kommentar = f"{bearb_num}: "
self.vorgaenge.append({
"nummer": nummer,
"start": datetime.now(),
"stopp": None,
"kommentar": kommentar
})
speichere_daten(self.vorgaenge)
self.aktualisiere_liste()
def stoppe_auswahl(self):
index = self.listbox.curselection()
if not index:
messagebox.showwarning("Hinweis", "Bitte wähle einen Vorgang aus.")
return
vorgang = self.vorgaenge[index[0]]
if vorgang["stopp"]:
messagebox.showinfo("Hinweis", "Dieser Vorgang wurde bereits gestoppt.")
return
benutzer_kommentar = simpledialog.askstring("Kommentar", "Kommentar zum Vorgang:")
vorgang["stopp"] = datetime.now()
# Kommentar an Bearbeitungsnummer anhängen (falls vorhanden)
if vorgang["kommentar"]:
if benutzer_kommentar:
vorgang["kommentar"] = f"{vorgang['kommentar']} {benutzer_kommentar}"
else:
vorgang["kommentar"] = benutzer_kommentar if benutzer_kommentar else ""
speichere_daten(self.vorgaenge)
self.aktualisiere_liste()
def loesche_auswahl(self):
index = self.listbox.curselection()
if not index:
messagebox.showwarning("Hinweis", "Bitte wähle einen Vorgang aus.")
return
if messagebox.askyesno("Löschen", "Bist du sicher, dass du den ausgewählten Vorgang löschen willst?"):
del self.vorgaenge[index[0]]
speichere_daten(self.vorgaenge)
self.aktualisiere_liste()
messagebox.showinfo("Gelöscht", "Der ausgewählte Vorgang wurde gelöscht.")
def reset(self):
if messagebox.askyesno("Zurücksetzen", "Bist du sicher, dass du alle Daten löschen willst?"):
self.vorgaenge.clear()
self.maschinennummer.set("")
reset_daten()
self.aktualisiere_liste()
messagebox.showinfo("Zurückgesetzt", "Alle Daten wurden gelöscht.")
def oeffne_excel_datei(self):
if not config.SERVER_EXCEL:
messagebox.showerror("Fehler", "Kein Pfad zur Bearbeitungs-Excel gesetzt.\nOptionen → „Bearbeitungs-Excel festlegen…“")
return
if not os.path.exists(config.SERVER_EXCEL):
messagebox.showerror("Fehler", f"Excel-Datei nicht gefunden:\n{config.SERVER_EXCEL}")
return
try:
os.startfile(config.SERVER_EXCEL) # Windows
except AttributeError:
# Fallback für andere Systeme
import subprocess, sys
if sys.platform == "darwin":
subprocess.call(["open", config.SERVER_EXCEL])
else:
subprocess.call(["xdg-open", config.SERVER_EXCEL])
# ------------------------- Anzeige / Darstellung ----------------------
def berechne_dauer_min(self, start: datetime, stopp: datetime) -> float:
return round((stopp - start).total_seconds() / 60, 2)
def aktualisiere_liste(self):
self.listbox.delete(0, tk.END)
for v in self.vorgaenge:
start_str = v["start"].strftime(DATUM_FORMAT) if v["start"] else ""
if v["stopp"]:
stopp_str = v["stopp"].strftime(DATUM_FORMAT)
dauer_str = f"{self.berechne_dauer_min(v['start'], v['stopp'])} Min"
else:
stopp_str = "Läuft..."
dauer_str = ""
bearb_nummer = v.get("bearbeitungsnummer", "")
kommentar = v["kommentar"] if v["kommentar"] else ""
# Anzeige: Nummer | Bearb.-Nr. | Start | Stopp | Dauer | Kommentar
eintrag = f"{v['nummer']} | {bearb_nummer} | {start_str} | {stopp_str} | {dauer_str} | {kommentar}"
self.listbox.insert(tk.END, eintrag)
# ------------------------------ Themes --------------------------------
def _open_theme_window(self):
# Hinweis: Das Layout ist auf hell optimiert. Umschalten möglich, aber rein optisch.
theme_window = tk.Toplevel(self.root)
theme_window.title("Darstellung")
theme_window.geometry("260x150")
theme_window.configure(bg=self.bg_color)
theme_var = tk.StringVar(value="light") # default: light
def apply_theme():
val = theme_var.get()
if val == "dark":
messagebox.showinfo("Info", "Dark Mode ist aktuell nur eingeschränkt unterstützt (UI ist für hell optimiert).")
theme_window.destroy()
tk.Radiobutton(
theme_window, text="Light (empfohlen)", variable=theme_var, value="light",
bg=self.bg_color, fg=self.fg_color, selectcolor="#FFFFFF"
).pack(pady=(12, 4))
tk.Radiobutton(
theme_window, text="Dark (experimentell)", variable=theme_var, value="dark",
bg=self.bg_color, fg=self.fg_color, selectcolor="#FFFFFF"
).pack()
ttk.Button(theme_window, text="Anwenden", command=apply_theme).pack(pady=12)
"""
import os
import tkinter as tk
import tkinter.ttk as ttk
from tkinter import messagebox, simpledialog
from datetime import datetime
from PIL import Image, ImageTk
from storage import lade_daten, speichere_daten, reset_daten
from export import exportiere_txt, exportiere_excel
from integra_lookup import finde_integra_nummern
from config import LOGO_PATH, DATUM_FORMAT
import config
class ZeitErfassungApp:
# ---------------------- Optionen / Einstellungen ----------------------
def _set_excel_path(self):
from tkinter import filedialog
pfad = filedialog.askopenfilename(
title="Bearbeitungs-Excel wählen",
filetypes=[
("Excel", "*.xlsx *.xlsm *.xlsb *.xls"),
("Alle Dateien", "*.*")
],
)
if pfad:
config.set_server_excel(pfad)
messagebox.showinfo("Gespeichert", f"Pfad gespeichert:\n{config.SERVER_EXCEL}")
# --------------------------- Konstruktor ------------------------------
def __init__(self, root: tk.Tk):
self.root = root
self.root.title("Zeiterfassung MERZ")
self.root.geometry("900x560")
# Fenstericon setzen (ICO bevorzugt, PNG geht auf manchen Systemen auch)
try:
icon_path = LOGO_PATH
if icon_path.lower().endswith(".ico"):
self.root.iconbitmap(icon_path)
else:
img = Image.open(icon_path)
icon_img = ImageTk.PhotoImage(img)
self.root.iconphoto(True, icon_img)
self._icon_ref = icon_img
except Exception as e:
print(f"Fenstericon konnte nicht gesetzt werden: {e}")
# Daten
self.vorgaenge = lade_daten()
# Grundfarben (helle Palette)
self.bg_color = "#F5F5F7"
self.fg_color = "#1D1D1F"
self.root.configure(bg=self.bg_color)
# UI aufbauen
self._build_gui()
self._build_menu()
self._create_busy_overlay()
self.aktualisiere_liste()
# --------------------------- Apple-Style ------------------------------
def _apply_apple_style(self):
self.bg = "#F5F5F7" # Fensterhintergrund
self.card = "#FFFFFF" # Karten/Flächen
self.border = "#E5E5EA"
self.text = "#1D1D1F"
self.subtext = "#3A3A3C"
self.blue = "#0A84FF" # Akzent
self.blue_hover = "#147CFF"
self.blue_pressed = "#0068DA"
self.neutral_hover = "#F2F2F7"
style = ttk.Style()
style.theme_use("default")
# Globale Schrift
style.configure(".", background=self.bg, foreground=self.text, font=("Segoe UI", 11))
# Karten / Toolbar
style.configure("Card.TFrame", background=self.card, borderwidth=1, relief="solid")
style.configure("Toolbar.TFrame", background=self.bg)
# Labels
style.configure("TLabel", background=self.bg, foreground=self.text, font=("Segoe UI", 11))
style.configure("Title.TLabel", background=self.bg, foreground=self.text, font=("Segoe UI", 16, "bold"))
style.configure("Secondary.TLabel", background=self.bg, foreground=self.subtext)
# Entry
style.configure("TEntry", fieldbackground=self.card, background=self.card, foreground=self.text)
# Neutraler Button
style.configure("TButton", background=self.card, foreground=self.text, padding=(12, 8),
borderwidth=1, relief="flat")
style.map("TButton",
background=[("active", self.neutral_hover)],
relief=[("pressed", "sunken")])
# Primär-Button (sichtbarere States)
style.configure("Accent.TButton", background=self.blue, foreground="#FFFFFF",
padding=(14, 9), borderwidth=0, relief="flat")
style.map("Accent.TButton",
background=[("active", self.blue_hover), ("pressed", self.blue_pressed)])
# Danger-Button (optional nutzbar)
style.configure("Danger.TButton", background="#FF3B30", foreground="white",
padding=(12, 8), borderwidth=0, relief="flat")
style.map("Danger.TButton",
background=[("active", "#FF554D"), ("pressed", "#D92A21")])
# Progressbar
style.configure("Thin.Horizontal.TProgressbar", troughcolor=self.card, background=self.blue)
# ---------------------------- GUI-Aufbau ------------------------------
def _build_gui(self):
self._apply_apple_style()
# Toolbar oben
toolbar = ttk.Frame(self.root, style="Toolbar.TFrame")
toolbar.pack(fill="x", padx=12, pady=(8, 12))
# Logo + Titel
try:
logo_img = Image.open(LOGO_PATH).resize((32, 32), Image.LANCZOS)
self.logo = ImageTk.PhotoImage(logo_img)
ttk.Label(toolbar, image=self.logo, style="TLabel").pack(side="left", padx=(0, 8))
except Exception:
pass
ttk.Label(toolbar, text="Zeiterfassung", style="Title.TLabel").pack(side="left")
ttk.Label(toolbar, text="", style="TLabel").pack(side="left", expand=True) # Spacer
# Primäraktion
self.start_button = ttk.Button(toolbar, text="Start", command=self.start_vorgang, style="Accent.TButton")
self.start_button.pack(side="right")
# Hauptkarte
main_card = ttk.Frame(self.root, style="Card.TFrame")
main_card.pack(fill="both", expand=True, padx=12, pady=(0, 12))
# Eingabezeile
row = ttk.Frame(main_card, style="Card.TFrame")
row.pack(fill="x", padx=12, pady=12)
self.maschinennummer = tk.StringVar()
ttk.Label(row, text="Maschinennummer:").pack(side="left", padx=(0, 8))
entry = ttk.Entry(row, textvariable=self.maschinennummer, width=40)
entry.pack(side="left")
entry.focus_set()
# Liste + Scrollbar
list_frame = ttk.Frame(main_card, style="Card.TFrame")
list_frame.pack(fill="both", expand=True, padx=12, pady=(0, 12))
scrollbar = ttk.Scrollbar(list_frame, orient="vertical")
scrollbar.pack(side="right", fill="y")
self.listbox = tk.Listbox(
list_frame,
width=100,
font=("Segoe UI", 10),
activestyle="none",
borderwidth=0,
highlightthickness=0,
bg=self.card,
fg=self.text,
selectbackground="#D0E7FF",
selectforeground=self.text
)
self.listbox.pack(side="left", fill="both", expand=True)
self.listbox.config(yscrollcommand=scrollbar.set)
scrollbar.config(command=self.listbox.yview)
# Aktionsleiste unten
actions = ttk.Frame(main_card, style="Toolbar.TFrame")
actions.pack(fill="x", padx=12, pady=(0, 12))
ttk.Button(actions, text="Stop mit Kommentar", command=self.stoppe_auswahl).pack(side="left")
ttk.Button(actions, text="Auswahl löschen", command=self.loesche_auswahl).pack(side="left", padx=(8, 0))
ttk.Button(actions, text="Alles zurücksetzen", command=self.reset, style="Danger.TButton").pack(side="left", padx=(8, 0))
ttk.Button(actions, text="Export TXT",
command=lambda: self._with_busy(lambda: exportiere_txt(self.vorgaenge, self.berechne_dauer_min),
toast="TXT exportiert")).pack(side="right")
ttk.Button(actions, text="Export Excel",
command=lambda: self._with_busy(lambda: exportiere_excel(self.vorgaenge, self.berechne_dauer_min),
toast="Excel exportiert")).pack(side="right", padx=(0, 8))
# ------------------------------ Menü ---------------------------------
def _build_menu(self):
menubar = tk.Menu(self.root)
# Optionen
optionen_menu = tk.Menu(menubar, tearoff=0)
darstellung_menu = tk.Menu(optionen_menu, tearoff=0)
darstellung_menu.add_command(label="Theme wechseln", command=self._open_theme_window)
optionen_menu.add_command(label="Projekt")
optionen_menu.add_command(label="Extras")
optionen_menu.add_command(label="Bearbeitungs-Excel festlegen…", command=self._set_excel_path)
optionen_menu.add_cascade(label="Darstellung", menu=darstellung_menu)
menubar.add_cascade(label="Optionen", menu=optionen_menu)
# Bearbeiten
bearbeiten_menu = tk.Menu(menubar, tearoff=0)
bearbeiten_menu.add_command(label="Bearbeitungstabelle öffnen", command=self.oeffne_excel_datei)
menubar.add_cascade(label="Bearbeiten", menu=bearbeiten_menu)
self.root.config(menu=menubar)
# --------------------------- Busy/Toast UI ----------------------------
def _create_busy_overlay(self):
# halbtransparente Überlagerung (ohne echte Alpha auf Widgets)
self._overlay = tk.Frame(self.root, bg="#000000") # dunkler Schleier
self._overlay.place_forget() # erst mal verstecken
inner = tk.Frame(self._overlay, bg=self.card, highlightthickness=1, highlightbackground=self.border)
inner.place(relx=0.5, rely=0.5, anchor="center")
inner.configure(padx=20, pady=14)
lbl = tk.Label(inner, text="Bitte warten…", bg=self.card, fg=self.text, font=("Segoe UI", 11, "bold"))
lbl.pack(pady=(0, 8))
self._pbar = ttk.Progressbar(inner, mode="indeterminate", length=240, style="Thin.Horizontal.TProgressbar")
self._pbar.pack()
# Toast (kleine Meldung unten rechts)
self._toast = tk.Label(self.root, text="", bg="#222222", fg="white",
font=("Segoe UI", 10), padx=10, pady=6)
def start_vorgang(self):
nummer = self.maschinennummer.get().strip()
if not nummer:
@@ -357,3 +753,4 @@ class ZeitErfassungApp:
bg=self.bg_color, fg=self.fg_color, selectcolor="#FFFFFF"
).pack()
ttk.Button(theme_window, text="Anwenden", command=apply_theme).pack(pady=12)
"""