Skip to content

Keep the session panel stacked when its sections are collapsed (fixes #754) - #755

Merged
marcinz606 merged 1 commit into
mainfrom
fix/panel-collapse-spread
Aug 4, 2026
Merged

Keep the session panel stacked when its sections are collapsed (fixes #754)#755
marcinz606 merged 1 commit into
mainfrom
fix/panel-collapse-spread

Conversation

@marcinz606

Copy link
Copy Markdown
Owner

Collapsing the Film Strip spread the left panel's contents — logo, toolbar, filter row, section header — evenly down the whole dock instead of leaving them stacked at the top (#754).

_rebalance_sections pins a collapsed section to its header height and gives it stretch 0. That is deliberate, but it left FileBrowser's layout with no item able to grow: the toolbar and filter rows are fixed height, and both sections are capped. With every section shut, Qt falls back to spreading the surplus into the gaps between rows.

A trailing addStretch(0) absorbs it. Stretch 0 rather than 1, so an expanded section still takes the whole surplus — expanded geometry is unchanged (the 40/60 split and the single-section case measure identically before and after).

Easiest to hit before a library exists: the Library section stays hidden until it has roots, so the Film Strip is the only section there is to collapse. Both-collapsed had the same fault.

test_collapsing_both_sections_keeps_the_panel_top_aligned covers it on realized geometry — the existing tests only assert stretch factors, which were already correct. Confirmed it fails without the fix (section at y≈707 in a 900px panel, y≈115 with it).

The issue's second remark — no Library dropdown — is that hidden-until-roots behaviour, answered in the thread. No change here.

A collapsed section is pinned to its header height with stretch 0, so with
every section shut nothing in the panel could take the leftover height and Qt
spread it into the gaps between the toolbar, the filter row and the headers —
the panel's contents ended up evenly spaced down the whole dock.

A trailing stretch absorbs it. Stretch 0 keeps an open section's share intact.

Hit most easily before a library exists: that section is hidden until it has
roots, leaving the film strip as the only one to collapse.

Fixes #754
@marcinz606
marcinz606 merged commit 07a7f18 into main Aug 4, 2026
1 check passed
@marcinz606
marcinz606 deleted the fix/panel-collapse-spread branch August 4, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant