Skip to content

Apply split percentage once size is known - #49

Merged
sylvestre merged 1 commit into
opencollab:masterfrom
danilovesky:fix-split-proportion-on-import
Nov 24, 2026
Merged

sylvestre merged 1 commit into
opencollab:masterfrom
danilovesky:fix-split-proportion-on-import

Conversation

@danilovesky

Copy link
Copy Markdown
Contributor

Without constant percent, a split proportion set before the split pane has a size was lost (stored layouts came back at 0.5 or Swing's preferred sizes). DockingSplitPane now keeps the percentage and applies it in setBounds() once the size is known, as constant-percent mode already does.

Fixes #33

@mergify

mergify Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@danilovesky

Copy link
Copy Markdown
Contributor Author

@sylvestre This is the last "urgent" fix I wanted to make. Handling of corner cases is much more robust now: in my FlexDock-based project I used to see exceptions, unexpected size changes and even lost layout files, but not anymore.

After the remaining PRs are merged, I'd propose bumping the version to v1.4 and doing a proper release. I can prepare a PR that bumps the poms and dates the release notes; the tag and publishing would be up to you. Since a few public APIs were removed and the minimum Java version changed, v2.0 would also be defensible, so I'm happy to go with whichever you prefer.

@danilovesky
danilovesky force-pushed the fix-split-proportion-on-import branch from 8ef313b to e7050e7 Compare November 23, 2026 09:19
Comment thread release-notes.txt Resolved
Without constant percent, JSplitPane converted the percentage to pixels
from the zero size of a split that was not laid out yet, so a stored
proportion was lost on importLayout (0.5 below 1/3, preferred sizes
from 1/3 on). Keep the percentage and apply it in setBounds() once the
size is known, as constant-percent mode does. An explicit pixel
location set in the meantime replaces the waiting percentage.

Fixes opencollab#33
@danilovesky
danilovesky force-pushed the fix-split-proportion-on-import branch from e7050e7 to 19f2c9f Compare November 23, 2026 19:26
@sylvestre
sylvestre merged commit c094d48 into opencollab:master Nov 24, 2026
7 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

@danilovesky
danilovesky deleted the fix-split-proportion-on-import branch November 24, 2026 17:20
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.

Stored split proportion is ignored on importLayout without constant percent

2 participants