Commit Graph

1069 Commits

Author SHA1 Message Date
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
e18baa13d1 Add a Item ctor just for the case it's a placeholder
For use when we're restoring a layout
2019-07-24 17:20:30 +01:00
Sergio Martins
8f92e6490b Add some convenience methods 2019-07-24 17:19:52 +01:00
Sergio Martins
77c48aa154 Also register frames, needed for restore 2019-07-24 12:42:13 +01:00
Sergio Martins
a40adbe0b8 Also restore the placeholder items 2019-07-24 11:54:32 +01:00
Sergio Martins
d66a14ee18 Register layouts 2019-07-24 11:52:49 +01:00
Sergio Martins
e5e590e498 Fix non-developer build 2019-07-24 10:29:50 +01:00
Sergio Martins
962b6d6779 Actually remove the qRegisterMetaType, Q_DECLARE_METATYPE is enough
The bug was fixed by using the fully qualified name in Q_PROPERTY
2019-07-24 09:52:05 +01:00
Sergio Martins
1788e6199b Register ItemList in Anchor ctor and use fully qualified name
works now on gammaray
2019-07-24 09:49:46 +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
602f15df90 Register ItemList, trying to get it to appear on gammaray 2019-07-23 22:46:42 +01:00
Sergio Martins
3bab6cad59 In checkSanity(), check the anchors before the items
Since anchors are easier to debug it's better to see those warnings
first
2019-07-23 22:19:26 +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
2ab56f47f0 Don't crash in AnchorGroup::debug() as anchors can be nullptr
Anchors shouldn't be null, but this debug() is called when weird
things happen so we can debug them, so dont crash
2019-07-23 21:30:40 +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
0c0c3975a3 Silence debug 2019-07-23 13:45:00 +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
a251e827ce Restore geometry first
So we don't get resize events doing extra work after
2019-07-23 13:31:43 +01:00
Sergio Martins
d4ba1f3c8c Don't keep stale static anchors around 2019-07-23 12:07:27 +01:00
Sergio Martins
1c93e74b6a Use addItems_internal() when adding the item
It installs an event filter
2019-07-23 11:55:54 +01:00
Sergio Martins
43f3030979 pass Anchor by pointer so it's normalized 2019-07-23 11:51:36 +01:00
Sergio Martins
b6889b5c54 No need to assign to m_anchors
Anchor CTOR does that
2019-07-23 11:49:28 +01:00
Sergio Martins
ab24161657 Remove unneeded Frame::id() 2019-07-23 11:42:52 +01:00
Sergio Martins
0e1b473db7 Also restore item's anchors 2019-07-23 11:35:00 +01:00
Sergio Martins
b14f66ee13 Check for invalid groups in checkSanity() 2019-07-23 11:23:36 +01:00
Sergio Martins
52c1cd510e Fix typos 2019-07-22 23:19:54 +01:00
Sergio Martins
574b9fbfa3 Set frame visible when restoring it 2019-07-22 23:05:53 +01:00
Sergio Martins
6c5ad286f3 Disconnect earlier, so we don't crash when deleting directly 2019-07-22 21:51:27 +01:00
Sergio Martins
3ef09fde11 Move code to where it's used 2019-07-22 19:46:30 +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
7b202fee5a Hide dock widgets before clearing layout
So that dock widgets are unparented before clearing the layout
Fixes a regression introduced recently. Tests pass now
2019-07-22 17:50:42 +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
c253962f87 Make DockRegistry::nestedWindows() not return the ones being deleted 2019-07-22 17:31:49 +01:00
Sergio Martins
bc93f924fc Disable the Animated Indicators for now
They don't work yet
2019-07-22 11:18:43 +01:00
Sergio Martins
9cad96b8ef Add needed friend declaration 2019-07-22 11:10:17 +01:00
Sergio Martins
14a393dfb3 Remove dead code from LayoutSaver 2019-07-22 10:50:29 +01:00
Sergio Martins
1cecc30c54 Also save/restore window geometry and visibility
also restore the FloatingWindow
2019-07-22 10:44:11 +01:00
Sergio Martins
ddb772d54f Fix clazy build 2019-07-22 09:34:15 +01:00
Sergio Martins
05532b892c Fix build 2019-07-21 23:43:42 +01:00
Sergio Martins
4acced799c Ensure all floating DockWidgets morphed into a FloatingWindow before saving
Makes it easier, since it's less one case to handle
2019-07-21 23:42:22 +01:00
Sergio Martins
228870df68 Serialize FloatingWindow 2019-07-21 23:42:08 +01:00
Sergio Martins
f1d5fd4b67 Before restoring a layout, clear old placeholders too 2019-07-21 23:28:06 +01:00