Same for restore.
This is better API as LayoutSaver shouldn't be concerned about
QSettings. It also assumed the user only had a single layout, which
is normally not the case.
And finally, storing escaped json in .ini files is not very elegant.
Bug was happening when calling close() an closed dock widget, it
would then save the position of the invisible window. Next time it
was open it would appear in a bogus location. 0,0 in my case.
And renamed it to 17.json, as we already have an unrelated 2.json.
The removed check isn't needed, as we'll check again when we
finish restoring the placeholder. It was also a false-positive
warning sometimes because boundPositionForAnchor() would fail
since the "anchors following" wasnt initialized yet, as we do
a clearAnchorsFollowing while restoring the placeholder
Our RAII class that ensures that each test leaves 0 top-levels behind
was being initialized with somthing bigger than 0 since the
rectForDrop() test wasn't doing proper cleanup.
Not sure why only repro with 5.9, but it's correct now.
To repro:
- stack 3 dock widgets vertically
- close the top one
- close the top one
The remaining one should now fill the whole window but it wasn't.
Culprit was the code that makes sure that when a dock is closed that
the adjacent ones get to share their space
It doesn't make sense to only grow one side, as sometimes the item
must grow in both sizes, as the right side might now have enough
to acomodate its needs.
This also allows us to not use Anchor::ensureBounded(), as separators
being within their bounds doesn't imply min sizes being respected, while
the inverse is true
fuzzer testcase 10.json now passes
When adjusting the vertical separators we should only check if
the group has enough width. It's height is adjusted in ensureAnchorsBounded().
(And vice-versa)
Found via fuzzer's test-case 9.json. Passes now.
We don't want to count the size of separators that are following
others, but we might be in the middle of an operation that will
change which separators are following, like when restoring a placeholder.
So query the actual separators that will follow.
Fixes fuzzer 8.json and 2.json