Firmendialog passt sich dem Bildschirm an
Mit den neuen Bild- und Farbzeilen reichten 640 px nicht mehr: rechts fielen "Entfernen" und unten "Speichern" aus dem Fenster - gesehen im laufenden Programm, nicht im Code. Der Dialog richtet sich jetzt nach dem Bildschirm (700-900 breit, hoehenbegrenzt) und die Felder sind etwas schmaler. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V4t48uxDok5rJXhC9bX1Ax
This commit is contained in:
parent
fe0c4a8e08
commit
0ad03fd1a4
1 changed files with 8 additions and 5 deletions
|
|
@ -334,7 +334,10 @@ class EinstellungenMixin:
|
|||
d.transient(self)
|
||||
d.grab_set()
|
||||
self._style_dialog(d)
|
||||
d.geometry("640x740")
|
||||
breite = min(900, max(700, d.winfo_screenwidth() - 200))
|
||||
hoehe = min(760, max(560, d.winfo_screenheight() - 140))
|
||||
d.geometry(f"{breite}x{hoehe}")
|
||||
d.minsize(700, 560)
|
||||
|
||||
frm = ttk.Frame(d, padding=12)
|
||||
frm.pack(fill="both", expand=True)
|
||||
|
|
@ -349,7 +352,7 @@ class EinstellungenMixin:
|
|||
for i, (key, lbl) in enumerate(felder):
|
||||
ttk.Label(frm, text=lbl).grid(row=i, column=0, sticky="w", pady=2)
|
||||
v = tk.StringVar(value=self.cfg["firma"].get(key, ""))
|
||||
ttk.Entry(frm, textvariable=v, width=58).grid(row=i, column=1, sticky="ew", padx=(8, 0), pady=2)
|
||||
ttk.Entry(frm, textvariable=v, width=44).grid(row=i, column=1, sticky="ew", padx=(8, 0), pady=2)
|
||||
vars_[key] = v
|
||||
frm.columnconfigure(1, weight=1)
|
||||
base = len(felder)
|
||||
|
|
@ -421,16 +424,16 @@ class EinstellungenMixin:
|
|||
probe_zeigen()
|
||||
|
||||
ttk.Label(frm, text="Danktext 1").grid(row=base + 3, column=0, sticky="nw", pady=2)
|
||||
t1 = tk.Text(frm, width=58, height=3, wrap="word", bg=self.col_field, fg=self.col_fg, insertbackground=self.col_fg)
|
||||
t1 = tk.Text(frm, width=44, height=3, wrap="word", bg=self.col_field, fg=self.col_fg, insertbackground=self.col_fg)
|
||||
t1.insert("1.0", self.cfg["texte"].get("dank1", ""))
|
||||
t1.grid(row=base + 3, column=1, sticky="ew", padx=(8, 0), pady=2)
|
||||
ttk.Label(frm, text="Danktext 2").grid(row=base + 4, column=0, sticky="nw", pady=2)
|
||||
t2 = tk.Text(frm, width=58, height=3, wrap="word", bg=self.col_field, fg=self.col_fg, insertbackground=self.col_fg)
|
||||
t2 = tk.Text(frm, width=44, height=3, wrap="word", bg=self.col_field, fg=self.col_fg, insertbackground=self.col_fg)
|
||||
t2.insert("1.0", self.cfg["texte"].get("dank2", ""))
|
||||
t2.grid(row=base + 4, column=1, sticky="ew", padx=(8, 0), pady=2)
|
||||
ttk.Label(frm, text="Hinweiszeile").grid(row=base + 5, column=0, sticky="w", pady=2)
|
||||
vh = tk.StringVar(value=self.cfg["texte"].get("hinweis", ""))
|
||||
ttk.Entry(frm, textvariable=vh, width=58).grid(row=base + 5, column=1, sticky="ew", padx=(8, 0), pady=2)
|
||||
ttk.Entry(frm, textvariable=vh, width=44).grid(row=base + 5, column=1, sticky="ew", padx=(8, 0), pady=2)
|
||||
|
||||
def speichern():
|
||||
for key, v in vars_.items():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue