Sergio Martins
c9b596238c
Add a failing test
2019-07-24 22:41:51 +01:00
Sergio Martins
dc7d5a925c
tests++
2019-07-24 17:39:55 +01:00
Sergio Martins
fd795d9925
Only restore placeholders after the items are created
2019-07-24 17:30:03 +01:00
Sergio Martins
edd0443055
Fix Anchor::m_initialized not being true after a restore
...
Was causing Anchor::updateItemSizes() to be skipped
2019-07-23 22:55:18 +01:00
Sergio Martins
976a846f14
Emit widgetCountChanged only at the end when restoring
...
Otherwise it triggers code that shouldn't run while restore
is in progress
2019-07-23 22:18:45 +01:00
Sergio Martins
c5842eb34d
Dont' reparent FloatingWindow when restoring it
...
Instead pass the correct parent from the beginning.
Otherwise causes a bug in X11 where the FloatingWindow would
disappear sometimes, even if isVisible() and geometry were correct.
The test doesn't really catch it, as the properties are correct,
but visually it can be seen. Commiting the test anyway.
2019-07-23 18:46:09 +01:00
Sergio Martins
edf1d74044
Reenable tst_restoreCrash, it passes
2019-07-23 18:04:56 +01:00
Sergio Martins
7c4a7caa40
Fix restored Frame not calling updateTitleBarVisibility()
...
It's called when parent changes. We could just call it after restoring
but I rather have the paths normalized, so now it uses the same path
when restoring as when adding
2019-07-23 17:42:46 +01:00
Sergio Martins
10c2b0fa77
Reenable layout storing
2019-07-23 17:08:54 +01:00
Sergio Martins
0243dd4ed4
Add a more complex test
2019-07-23 16:59:36 +01:00
Sergio Martins
f585f06422
Restore geometry of closed dock widgets too
2019-07-23 15:08:14 +01:00
Sergio Martins
6e550c05c5
When restoring FloatingWindow set the correct window flags
...
It wasn't being created as a window
2019-07-23 13:52:52 +01:00
Sergio Martins
a9a9e3b828
Be sure to have the static anchors set before calling addItems_internal()
2019-07-23 13:33:59 +01:00
Sergio Martins
d4ba1f3c8c
Don't keep stale static anchors around
2019-07-23 12:07:27 +01:00
Sergio Martins
0e1b473db7
Also restore item's anchors
2019-07-23 11:35:00 +01:00
Sergio Martins
574b9fbfa3
Set frame visible when restoring it
2019-07-22 23:05:53 +01:00
Sergio Martins
8cca303e1b
Delete Frame immediately instead of deleteLater when possible
...
Otherwise a LayoutSaver::saveLayout() will count with those frames
that aren't deleted yet and are keeping Items alive.
Also easier for tests, not so many waitForDeleted() needed
2019-07-22 18:40:01 +01:00
Sergio Martins
7e02d2d953
Fix tests broken due to non-unique MainWindow/DockWidget names
2019-07-22 17:50:22 +01:00
Sergio Martins
947969438d
LayoutSaver: Make the deserializer match the serializer
...
They must be simmetric
2019-07-22 17:32:24 +01:00
Sergio Martins
5274c8a9fd
Rename method
2019-07-21 23:27:58 +01:00
Sergio Martins
ed2bd24f46
Fix crash while restoring empty layout
2019-07-21 20:29:42 +01:00
Sergio Martins
bb1a933137
Transform floating dock widgets into FloatingWindow
...
instead of waiting for the user to drag a window over it.
This makes it have better z-order, as the FloatingWindow is parented.
2019-07-20 22:15:24 +01:00
Sergio Martins
108cd96afe
Save floating geometry before hidding
...
So it shows at the correct position when shown
2019-07-20 17:19:20 +01:00
Sergio Martins
8427cd7f5f
tests: Don't spam so many qpa warnings
...
We don't care about these warnings so don't print them
2019-07-19 18:16:47 +01:00
Sergio Martins
cbef097bec
Improve MultiSplitterLayout::clear()
...
To be used by LayoutSaver before restoring
2019-07-19 12:18:46 +01:00
Sergio Martins
963e566cda
Ensure test doesn't leave windows open
2019-07-19 11:57:47 +01:00
Sergio Martins
48ae1b5feb
Add some simplifications
2019-07-18 22:30:17 +01:00
Sergio Martins
c430d40b0b
Uncomment test that passes now
2019-07-18 22:04:48 +01:00
Sergio Martins
f6259430a7
Variable renaming for readability
2019-07-17 23:02:39 +01:00
Sergio Martins
af94a5da6d
Added a needed debug to compare output between two shas
2019-07-17 22:11:18 +01:00
Sergio Martins
98e47856f3
tests: Simply getting the drop area
...
No need for casts
2019-07-17 21:32:45 +01:00
Sergio Martins
16e99dac8b
Fix rectForDrop() when one of the sides didn't have more space
...
The layout guarantees that there's enough space for the widget
and for the new anchor, but doesn't say in which side the new
anchor should steal space from, so bound the rect when we finish
calculating it
Finally we can uncomment the warning in Anchor::setPosition() to
detect out of bounds cases, tests pass now with no warning
2019-07-17 17:59:20 +01:00
Sergio Martins
e3f49653c3
Fix typo in rectForDrop(), found by unit-test
2019-07-17 15:47:47 +01:00
Sergio Martins
6d5116f7cf
tests++
2019-07-17 14:55:21 +01:00
Sergio Martins
f65fdef13e
tests: More tests for rectForDrop()
2019-07-17 12:03:45 +01:00
Sergio Martins
9fe0a191eb
Remove unneeded test, in the hope of removing MultiSplitterLayout::resizeItem()
...
which is not the correct way to resize items
2019-07-17 11:46:51 +01:00
Sergio Martins
fc380eab72
More tests for rectForDrop()
2019-07-17 11:46:42 +01:00
Sergio Martins
2b45aab88d
Propagate closing events
...
FloatingWindow now asks Frame if it should close
Frame asks its DockWidgets
DockWidget asks its widget
2019-07-16 22:36:08 +01:00
Sergio Martins
0abc315584
Share some tests code in utils.cpp
2019-07-16 22:13:22 +01:00
Sergio Martins
3c4dba77bf
Add tests/utils.h
...
tst_docks.cpp is becoming too big
2019-07-16 21:38:45 +01:00
Sergio Martins
007f483069
Support re-docking a frame with multiple dock widgets
2019-07-16 14:42:43 +01:00
Sergio Martins
b6c0353f7b
Fix anchor following not being updated when an item is removed
2019-07-16 11:54:20 +01:00
Sergio Martins
4a0bd209b8
Fix ASSERT in Anchor::setFollower()
2019-07-15 23:44:35 +01:00
Sergio Martins
a848810239
Add a failing test
2019-07-15 23:19:03 +01:00
Sergio Martins
8a6758c93d
Fix buggy Anchor::findNearestAnchorWithItems()
...
It was returning inside the loop, instead of honouring the candidate
2019-07-15 22:46:27 +01:00
Sergio Martins
0eb746ad22
Uncomment test that passes
2019-07-15 20:12:27 +01:00
Sergio Martins
1cdf9e1c9a
Add unit-test for checking that widgets preserve position after restored
2019-07-15 16:57:40 +01:00
Sergio Martins
8d31bb85fa
Fix clazy warnings
2019-07-15 13:10:17 +01:00
Sergio Martins
c96eb88023
Fix choosing which anchors to move when restoring placeholders
2019-07-15 00:16:58 +01:00
Sergio Martins
0aac8edb0c
Fix off by ones in rectForDrop()
...
It was accounting for the anchor thickness
2019-07-14 21:39:11 +01:00