From 45913534531225026af95c07ff02cdbea398b3ce Mon Sep 17 00:00:00 2001 From: "arda.aydin@ontrol.com.tr" Date: Wed, 9 Sep 2026 08:12:51 +0300 Subject: [PATCH] Kit Manager: all columns fixed width with horizontal scrollbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No columns stretch — sizes are set for the longest kit name (ontrolModbusTcpSlaveSmart) and action text (Keep with no checksum). A horizontal scrollbar appears when the pane is narrower than the total column width. Co-Authored-By: Claude Opus 4.6 --- app_state.py | 2 +- manage_kits.py | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app_state.py b/app_state.py index f13af90..e33761a 100644 --- a/app_state.py +++ b/app_state.py @@ -8,7 +8,7 @@ so later rebinding would only ever be seen by the module that did it. import configparser import os -VERSION = "0.0.0.067" +VERSION = "0.0.0.068" PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties") DEFAULT_GRID_SIZE = 10 DEFAULT_ADD_TIMESTAMP = True diff --git a/manage_kits.py b/manage_kits.py index 40ca1b2..6145753 100644 --- a/manage_kits.py +++ b/manage_kits.py @@ -213,23 +213,29 @@ class KitsPanel: self.frame = ttk.Frame(parent, padding=10) COLUMNS = ("name", "installed", "latest", "action") + + table_frame = ttk.Frame(self.frame) + table_frame.pack(fill=tk.BOTH, expand=True) + self.table = ttk.Treeview( - self.frame, columns=COLUMNS, show="tree headings", selectmode="browse", + table_frame, columns=COLUMNS, show="tree headings", selectmode="browse", ) self.table.heading("#0", text="") self.table.column("#0", width=32, minwidth=32, stretch=False, anchor="center") - for column, heading, width, stretch, anchor in [ - ("name", "Kit name", 200, True, "w"), - ("installed", "Installed", 105, False, "w"), - ("latest", "Latest", 105, False, "w"), - ("action", "Action", 300, False, "w"), + for column, heading, width, anchor in [ + ("name", "Kit name", 190, "w"), + ("installed", "Installed", 105, "w"), + ("latest", "Latest", 105, "w"), + ("action", "Action", 195, "w"), ]: self.table.heading(column, text=heading, anchor=anchor) - self.table.column(column, width=width, anchor=anchor, stretch=stretch) + self.table.column(column, width=width, minwidth=width, anchor=anchor, stretch=False) - scrollbar = ttk.Scrollbar(self.frame, orient=tk.VERTICAL, command=self.table.yview) - self.table.configure(yscrollcommand=scrollbar.set) - scrollbar.pack(side=tk.RIGHT, fill=tk.Y) + vscroll = ttk.Scrollbar(table_frame, orient=tk.VERTICAL, command=self.table.yview) + hscroll = ttk.Scrollbar(table_frame, orient=tk.HORIZONTAL, command=self.table.xview) + self.table.configure(yscrollcommand=vscroll.set, xscrollcommand=hscroll.set) + vscroll.pack(side=tk.RIGHT, fill=tk.Y) + hscroll.pack(side=tk.BOTTOM, fill=tk.X) self.table.pack(fill=tk.BOTH, expand=True) self.table.tag_configure(SECTION_TAG, background="#dcdcdc")