mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-08-24 22:45:18 +02:00
Line up the reminder items edit row with the table columns
Beschreibung/Betrag now sit on their own row directly under the table, sized to the same 220:100 ratio as the table's own columns, with the Hinzufügen/Aktualisieren/Entfernen buttons moved to a row below that instead of everything being crammed into one row. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
d4dfd0066a
commit
3940926a22
@@ -994,24 +994,33 @@ class ReminderDialog(_Dialog):
|
|||||||
self.items_tree.grid(row=0, column=0, sticky="ew")
|
self.items_tree.grid(row=0, column=0, sticky="ew")
|
||||||
self.items_tree.bind("<<TreeviewSelect>>", lambda _event: self._load_selected_item())
|
self.items_tree.bind("<<TreeviewSelect>>", lambda _event: self._load_selected_item())
|
||||||
|
|
||||||
controls = ttk.Frame(table_frame)
|
# Edit row lines up under the table's own columns (same 220:100 width ratio as
|
||||||
controls.grid(row=1, column=0, sticky="ew", pady=(8, 0))
|
# "Beschreibung"/"Betrag" above) instead of the fields and buttons being crammed
|
||||||
|
# into one row.
|
||||||
|
edit_row = ttk.Frame(table_frame)
|
||||||
|
edit_row.grid(row=1, column=0, sticky="ew", pady=(8, 0))
|
||||||
|
edit_row.columnconfigure(0, weight=22)
|
||||||
|
edit_row.columnconfigure(1, weight=10)
|
||||||
self.item_description_var = tk.StringVar()
|
self.item_description_var = tk.StringVar()
|
||||||
description_combo = ttk.Combobox(
|
description_combo = ttk.Combobox(
|
||||||
controls,
|
edit_row,
|
||||||
textvariable=self.item_description_var,
|
textvariable=self.item_description_var,
|
||||||
values=[str(entry.get("description", "")) for entry in self.policy["standard_fee_items"]],
|
values=[str(entry.get("description", "")) for entry in self.policy["standard_fee_items"]],
|
||||||
width=22,
|
|
||||||
)
|
)
|
||||||
description_combo.pack(side="left", padx=(0, 8))
|
description_combo.grid(row=0, column=0, sticky="ew", padx=(0, 8))
|
||||||
description_combo.bind("<<ComboboxSelected>>", lambda _event: self._prefill_item_amount())
|
description_combo.bind("<<ComboboxSelected>>", lambda _event: self._prefill_item_amount())
|
||||||
self.item_amount_var = tk.StringVar()
|
self.item_amount_var = tk.StringVar()
|
||||||
ttk.Entry(controls, textvariable=self.item_amount_var, width=10).pack(side="left", padx=(0, 8))
|
ttk.Entry(edit_row, textvariable=self.item_amount_var).grid(row=0, column=1, sticky="ew")
|
||||||
ttk.Button(controls, text="Position hinzufügen", command=self._add_item).pack(
|
|
||||||
|
buttons_row = ttk.Frame(table_frame)
|
||||||
|
buttons_row.grid(row=2, column=0, sticky="w", pady=(8, 0))
|
||||||
|
ttk.Button(buttons_row, text="Position hinzufügen", command=self._add_item).pack(
|
||||||
side="left", padx=(0, 8)
|
side="left", padx=(0, 8)
|
||||||
)
|
)
|
||||||
ttk.Button(controls, text="Aktualisieren", command=self._update_item).pack(side="left", padx=(0, 8))
|
ttk.Button(buttons_row, text="Aktualisieren", command=self._update_item).pack(
|
||||||
ttk.Button(controls, text="Position entfernen", command=self._remove_item).pack(side="left")
|
side="left", padx=(0, 8)
|
||||||
|
)
|
||||||
|
ttk.Button(buttons_row, text="Position entfernen", command=self._remove_item).pack(side="left")
|
||||||
|
|
||||||
def _prefill_item_amount(self) -> None:
|
def _prefill_item_amount(self) -> None:
|
||||||
description = self.item_description_var.get()
|
description = self.item_description_var.get()
|
||||||
|
|||||||
Reference in New Issue
Block a user