App tree: keep expanded folders open; only the - sign closes one

Rebuilding the tree (live child loads, edits) now restores every row that
was expanded, matched by component id or name path. Double-click no longer
toggles a row through ttk's default binding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 19:25:44 +03:00
co-authored by Claude Opus 5.5
parent 05ca7e9035
commit 96a703c5d5
3 changed files with 56 additions and 5 deletions
+8 -3
View File
@@ -1232,18 +1232,23 @@ def _open_special_view(comp):
def on_tree_double_click(event):
"""Double-click on a tree node opens its special view (or Properties)."""
"""Double-click on a tree node opens its special view (or Properties).
Returns "break" so ttk's own double-click does not also toggle the row: only the
+/- sign opens or closes a node.
"""
tree = app_state.tree
item_id = tree.identify_row(event.y)
if not item_id:
return
return "break"
comp = app_state.tree_element_map.get(item_id)
if comp is None:
return
return "break"
if tree.parent(item_id) == "":
show_properties(comp)
else:
_open_special_view(comp)
return "break"
def on_canvas_double_click(event):