Commit Graph

1228 Commits

Author SHA1 Message Date
Sergio Martins
ce7c913f8c Move the last floating geometry 1 level up
So it's not overwritten.
Added a unit-test for testing that floating geometry doesn't break
2020-05-21 19:32:18 +01:00
Sergio Martins
b4526b007c Make LastPositions::lastPosition private
Need to control how the setters are messing with it, to add more
of them
2020-05-21 18:56:44 +01:00
Sergio Martins
618ec9fd41 Minor, use the members directly 2020-05-21 18:15:06 +01:00
Sergio Martins
e1c18de48e Remove unused Frame::dumpDebug()
Should be operator<<(QDebug) anyway if we need it
2020-05-21 18:05:24 +01:00
Sergio Martins
9779b8edc3 Deal in terms of LastPositions instead of the individual position
Just a refactoring to add more encapsulation
2020-05-21 17:43:51 +01:00
Sergio Martins
50934ae56d Use a shared_ptr for Position, so we can pass LastPositions by value 2020-05-21 17:19:54 +01:00
Sergio Martins
2da37180b9 Start supporting multiple last positions
Pushing some boilerplate first, so the functional diff is smaller.
Wraps the old position class with one that will have many.
2020-05-21 16:52:03 +01:00
Sergio Martins
7ab1500651 Add a QDebug operator for Position 2020-05-21 15:28:24 +01:00
Sergio Martins
f260a76f8b Rename LastPosition to Position
so we can have a list of them, the dock widget might have been
in several main windows
2020-05-21 14:49:49 +01:00
Sergio Martins
ba740a4934 Do a complete relayout if the loaded json layout isn't valid
The layout can be valid on disk might it might happen that
the guest QWidgets have different min-sizes now (in a different
run of our app), so we need to relayout
2020-05-20 21:30:55 +01:00
Sergio Martins
e0f16ae57e Add a kddockwidgets_linter executable
For linking layout json files. Returns non 0 if invalid, and
probably some warnings too.
2020-05-20 19:19:07 +01:00
Sergio Martins
8a3e784ae2 Make layout saver create the main window if it's missing
and we have a factory. The same way it happens for dock widgets.
2020-05-20 19:19:07 +01:00
Sergio Martins
01112779b0 Add a Config::mainWindowFactoryFunc
Analog to the dock widget factory func.
To be used by the linter.
2020-05-20 19:06:54 +01:00
Sergio Martins
6de5860e9a Don't allow to drop to itself when having mainwindow inside dock widget 2020-05-20 16:33:48 +01:00
Sergio Martins
1061edb3b0 Remove asserts that are already guarded by a warning
that's enough for the tests to fail
2020-05-20 15:30:57 +01:00
Sergio Martins
88b830d297 set the max size on the item too when setting the guest widget
Not honoured yet
2020-05-20 14:33:27 +01:00
Sergio Martins
283d2a80c7 Add Item::maxSizeChanged signal and improve setter 2020-05-20 14:25:42 +01:00
Sergio Martins
215e8cfd24 example: Cleanup some options a bit 2020-05-20 14:25:23 +01:00
Sergio Martins
235018bfae example: Set the max-size before docking 2020-05-20 10:05:11 +01:00
Sergio Martins
dc87c05f04 example: Add an option to text max-sizes
Support not done yet, but useful for testing
2020-05-19 23:22:39 +01:00
Sergio Martins
4a17b04310 Item::dumpDebug: Also print the max-size, if any 2020-05-19 22:48:14 +01:00
Sergio Martins
6001e655fd Fix crash when moving separator
We weren't recurring up the tree to find the next separator
2020-05-19 14:46:30 +01:00
Sergio Martins
af22e3e12d Fix tst_raise on XCB 2020-05-19 13:44:01 +01:00
Sergio Martins
0d3ae48fed Refuse to save invalid layouts
Now layout saver won't save if the root ItemContainer::checkSanity()
is false
2020-05-19 13:15:31 +01:00
Sergio Martins
9e198917f0 Try to recover from loading an invalid layout 2020-05-19 12:35:33 +01:00
Laurent Montel
d2531d48d3 Make it compile against qt < 5.10 QRandomGenerator was created in qt5.10 2020-05-19 11:20:28 +02:00
Sergio Martins
dc0dab6a83 DebugWindow: Add button to show all dock widgets 2020-05-19 10:05:41 +01:00
Laurent Montel
8b81cd12f8 Compile without deprecated method (qrand is deprecated. Replaced by QRandomGenerator) 2020-05-19 11:03:38 +02:00
Sergio Martins
044c590b92 Fix ambiguous enum on Windows
Can happen when using an amalgamation, due to the "using namespace"
clauses
2020-05-18 22:00:52 +01:00
Sergio Martins
6c2a29968a Fix include 2020-05-18 21:51:26 +01:00
Sergio Martins
90fe9be6f6 DebugViewer: Fix crash at shutdown 2020-05-18 18:54:13 +01:00
Sergio Martins
2350f847d7 Item: Dump screen information too 2020-05-18 13:46:06 +01:00
Sergio Martins
8f7df69fa1 Add unit-test for previous commit 2020-05-18 11:48:18 +01:00
Sergio Martins
b687224801 Fix separators not moving when having invisible items
typo...
2020-05-18 11:40:33 +01:00
Sergio Martins
209005478e only build multisplitter test if in developer mode 2020-05-18 09:28:15 +01:00
Sergio Martins
af25af1259 Add MainWindow::layoutEqually()
Distributes the space equally between all dock widgets
2020-05-18 00:05:50 +01:00
Sergio Martins
8b0be3b2ba Add ItemContainer::layoutEqually()
Distributes all the space equally through the container.
Still respects min/max
2020-05-17 23:44:45 +01:00
Sergio Martins
43fafa1f33 Fix -Wextra-semi 2020-05-17 22:32:08 +01:00
Sergio Martins
ea56d20959 Fix clazy warnings about unused trivial variables 2020-05-17 19:15:59 +01:00
Sergio Martins
8477fdc7e1 Fix detachments 2020-05-17 19:14:50 +01:00
Sergio Martins
d613d25ef5 Add missing emit keyword 2020-05-17 19:12:09 +01:00
Sergio Martins
c5d9b38fc2 Disable copy of polymorphic types 2020-05-17 19:11:45 +01:00
Sergio Martins
36061fc6dc Fix detach of temporary 2020-05-17 19:08:07 +01:00
Sergio Martins
2b6b6e2ba5 Disable copy for LayoutSaver, it has a dtor, but no copy-ctor 2020-05-17 19:07:26 +01:00
Sergio Martins
adedcfd6db Use fully qualified types in signals 2020-05-17 19:06:24 +01:00
Sergio Martins
a9e02ccd41 example: Don't leak the dock widgets on shutdown 2020-05-17 18:02:03 +01:00
Sergio Martins
4647814aae Fix tests with Qt 5.9
QTabWidget is a bit flaky and changes min width at unexpected times.
Which is fine but we can't compare against the expected min size
since it changes. So just check sanity of the restored layout
2020-05-17 17:12:31 +01:00
Sergio Martins
5b1b029b80 Fix Item::calculateSqueezes() squeezing too much
Fixes tst_28NestedWidgets:28 with Qt 5.9
2020-05-17 16:28:36 +01:00
Sergio Martins
6fe998d9df Add build* to .gitignore 2020-05-17 15:04:53 +01:00
Sergio Martins
131b43a833 Item: Ignore item changing min size when it's not visible
Fixes tst_crash2 with Qt 5.9. Added a proper test too.
2020-05-17 15:03:54 +01:00