If the anchorThatMoved actually increased size then we were
calculating the signess wrong and the item would shrink.
Just check if the anchor is a side1 anchor in the group, if yes
then position must decrease so group grows
As they might be running on an incomplete state, during some
operation.
Instead move it to MultiSplitterLayout::checkSanity() which is
run at the end of operations
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
In the above case:
+--------+---+
| 1 | 6 |
| | |
+---+----| |
| 2 | 8 | |
| | | |
+---+----+---+
Supposing 8 is hidden (it's a placeholder), then the separator between 2
and 8 is following the big vertical one between 1 and 6. Now, if the size constraints
of the widget hosted by 2 increases, which might lead to the main window having to increase,
then we have to move that big separator. Problem was it was only honouring the min size of widget 1
because 8 was hidden.
ensureAnchorsBounded() shouldn't be run while in an inconsistent
state. And it's already run at the end of restoring placeholders.
Fixes fuzzer test case 2.json
It wasn't called because the min size decreased, so setSize()
was a no-op, so ensureAnchorsBounded() was skipped.
But the internal widgets constraints can change, so still call ensureAnchorsBounded().
So the layout can grow first and not complain there's not enough
space.
Fixes fuzzer test-case 3.json.
The warning was: "Constraints not honoured" in Item::onLayoutRequest()
It was intersecting with the Item by 1 pixel.
This fixes fuzzer test 1.json.
The warning would look like:
MultiSplitterLayout::checkSanity: Widget <item> with rect <rect> intersects anchor <anchor>
Gives:
MultiSplitterLayout::checkSanity: Widget KDDockWidgets::Item(0x55e8038d8f90)
with rect QRect(0,0 1953x407) Intersects anchor KDDockWidgets::Anchor(0x55e803a17ba0)
with rect QRect(1209,406 5x562)