mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-08-24 22:45:18 +02:00
Fix column order/widths and sizing in Hausmeister and GnuCash import
Hausmeister: reorder columns to Level, Fällig, Vorgang, Details. Level, Fällig and Vorgang get a fixed width; only Details stretches to fill the remaining space. GnuCash-Import dialog: opens at 80% of the current monitor's size (monitor-aware via the existing screeninfo-based helpers, not just the raw/virtual screen size) instead of a fixed 960x640. In its booking table, Import, Datum, Betrag and Status get a fixed width; Beschreibung and Memo share the remaining space. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
65bcc9f447
commit
e25accd35b
@@ -22,6 +22,7 @@ from ccma.services.gnucash_import import (
|
||||
list_transactions,
|
||||
)
|
||||
from ccma.storage.repository import MemberRepository, RepositoryError
|
||||
from ccma.ui.monitors import centered_geometry, preferred_monitor
|
||||
|
||||
|
||||
class GnuCashImportDialog(tk.Toplevel):
|
||||
@@ -55,7 +56,8 @@ class GnuCashImportDialog(tk.Toplevel):
|
||||
|
||||
self.title("Zahlungen aus GnuCash importieren")
|
||||
self.transient(master.winfo_toplevel())
|
||||
self.geometry("960x640")
|
||||
monitor = preferred_monitor(master.winfo_toplevel())
|
||||
self.geometry(centered_geometry(round(monitor.width * 0.8), round(monitor.height * 0.8), monitor))
|
||||
self.minsize(780, 480)
|
||||
self.protocol("WM_DELETE_WINDOW", self.destroy)
|
||||
self.bind("<Escape>", lambda _event: self.destroy())
|
||||
@@ -134,8 +136,8 @@ class GnuCashImportDialog(tk.Toplevel):
|
||||
("status", "Status", 220),
|
||||
):
|
||||
self.tree.heading(key, text=title)
|
||||
self.tree.column(key, width=width, anchor="w")
|
||||
self.tree.column("selected", anchor="center", stretch=False)
|
||||
self.tree.column(key, width=width, anchor="w", stretch=key in {"description", "memo"})
|
||||
self.tree.column("selected", anchor="center")
|
||||
self.tree.grid(row=0, column=0, sticky="nsew")
|
||||
scrollbar = ttk.Scrollbar(tree_frame, orient="vertical", command=self.tree.yview)
|
||||
scrollbar.grid(row=0, column=1, sticky="ns")
|
||||
|
||||
@@ -597,15 +597,15 @@ class HousekeeperTab(ttk.Frame):
|
||||
row=0, column=1, rowspan=2, padx=(0, 8)
|
||||
)
|
||||
ttk.Button(header, text="Tab schließen", command=self.on_close).grid(row=0, column=2, rowspan=2)
|
||||
self.tree = ttk.Treeview(self, columns=("severity", "title", "detail", "due"), show="headings")
|
||||
self.tree = ttk.Treeview(self, columns=("severity", "due", "title", "detail"), show="headings")
|
||||
for key, title, width in (
|
||||
("severity", "Level", 90),
|
||||
("due", "Fällig", 100),
|
||||
("title", "Vorgang", 330),
|
||||
("detail", "Details", 390),
|
||||
("due", "Fällig", 110),
|
||||
):
|
||||
self.tree.heading(key, text=title)
|
||||
self.tree.column(key, width=width, anchor="w")
|
||||
self.tree.column(key, width=width, anchor="w", stretch=key == "detail")
|
||||
self.tree.grid(row=1, column=0, sticky="nsew")
|
||||
self.tree.bind("<Double-1>", lambda _event: self._open_selected())
|
||||
self.tree.bind("<<TreeviewSelect>>", lambda _event: self._show_selected_details())
|
||||
@@ -649,7 +649,7 @@ class HousekeeperTab(ttk.Frame):
|
||||
"",
|
||||
"end",
|
||||
iid=str(index),
|
||||
values=(finding.severity.upper(), finding.title, finding.detail, finding.due_date or ""),
|
||||
values=(finding.severity.upper(), finding.due_date or "", finding.title, finding.detail),
|
||||
)
|
||||
|
||||
def _show_selected_details(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user