Left column: fixed width preference, auto scrollbars, pane floors

The tree and palette column took a share of every extra pixel the window
gained. It is now pinned to a width set in Preferences, defaulting to
230 px, so widening the window only ever feeds the wiresheet.

That fixed width brought two existing weaknesses into view:

- Long paths and type names had nowhere to go. Both lists now size their
  tree column to the widest visible row - ttk derives the horizontal
  scroll range from the column width, so a column left stretching can
  never scroll - and carry vertical and horizontal scrollbars that leave
  the grid when they have nothing to scroll.

- A short window squeezed the navigation tree away entirely. Both lists
  asked for ten rows, so the palette requested the most while the tree,
  carrying the larger weight, gave up its height first. The requested
  rows are now 6 and 5, a 300 px minimum window height keeps the
  shortfall shallow, and clamp_left_pane_split holds a dragged sash
  between the two floors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-04 21:06:21 +03:00
co-authored by Claude Opus 5
parent 13c7c71096
commit 5424d84156
3 changed files with 202 additions and 21 deletions
+14
View File
@@ -19,6 +19,15 @@ from sax_dom import (
)
_tree_filled = None
def set_tree_filled_callback(callback):
"""Registers what should run once the navigation tree has been rebuilt."""
global _tree_filled
_tree_filled = callback
def parse_xml_to_tree(treeview, parent_node, xml_element):
"""Recursively traverses XML elements and adds <comp> tags to the Treeview."""
for child in xml_element:
@@ -47,6 +56,8 @@ def refresh_treeview_from_dom(xml_root):
tree.delete(item)
if not app_state.current_file_path or xml_root is None:
if _tree_filled is not None:
_tree_filled()
return
file_name = os.path.basename(app_state.current_file_path)
@@ -58,6 +69,9 @@ def refresh_treeview_from_dom(xml_root):
else:
parse_xml_to_tree(tree, root_node, xml_root)
if _tree_filled is not None:
_tree_filled()
def reset_to_startup_state():
"""Returns the app to its just-launched state: no file, empty tree, empty sheet.