Keep the session panel stacked when its sections are collapsed (fixes #754) - #755
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_sectionspins a collapsed section to its header height and gives it stretch 0. That is deliberate, but it leftFileBrowser'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_alignedcovers 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.