Sergio Martins
7f981a1d1d
Item cleanup, moved LengthOnSide to impl
2020-05-24 14:05:04 +01:00
Sergio Martins
94b4051e31
Fix namespace build
2020-05-24 13:57:17 +01:00
Sergio Martins
86a2b14921
Move more code to GuestWidget
2020-05-23 21:14:11 +01:00
Sergio Martins
4fab2cf360
Move more code into GuestWidget
2020-05-23 20:11:27 +01:00
Sergio Martins
0a2fb6ed73
Add GuestWidget.h
...
The QtWidgets counter-part for GuestInterface.
Removing QWidget from Item
2020-05-23 19:22:01 +01:00
Sergio Martins
3d95263b40
Fix examples build with installed kddw
2020-05-23 19:00:12 +01:00
Sergio Martins
e75b47737c
Move GuestInterface into its own file
2020-05-23 18:59:58 +01:00
Sergio Martins
9ad6eefa7a
Add Layouting::Config
...
To host many of the scatered static member variables which
held some settings that rarely change
2020-05-23 18:40:20 +01:00
Sergio Martins
2527b39368
Moved the multisplitter wrapper outside of multisplitter/
...
As it depends on kddw framework, while multisplitter/ is the
agnostic layouting engine
2020-05-23 17:01:20 +01:00
Sergio Martins
71c7a7c9a9
Move more ItemContainer members to private
2020-05-23 16:46:43 +01:00
Sergio Martins
72c2586e20
Item: move a bunch of members to the private impl
2020-05-22 21:30:24 +01:00
Sergio Martins
7c5ed8bf84
Merge pull request #45 from OlivierJG/master
...
Fix include path so private header can be used
2020-05-22 20:30:51 +01:00
Olivier JG
70f0c49709
Fix include path so private header can be used
2020-05-22 14:17:02 -05:00
Sergio Martins
986a25971e
Also print the widget geometry if it's different from the item
2020-05-22 15:56:02 +01:00
Sergio Martins
0c776b6595
Fix non-developer build
2020-05-22 12:26:21 +01:00
Sergio Martins
7a852f700f
Save floating geometry right before starting a drag
...
so if you drop, then set floating again it goes to the original
floating position
2020-05-22 12:15:24 +01:00
Sergio Martins
bd848d8040
Add Draggable::singleDockWidget()
...
If the draggable only has a single dock widget, returns it.
Otherwise nullptr.
2020-05-22 12:14:12 +01:00
Sergio Martins
a7013b4cf7
Make DockWidget::setFloating(false) save the last docking position
...
so we can restore to it when floating again
2020-05-22 11:42:00 +01:00
Sergio Martins
8e39ce2dea
When floating via titlebar, restore to correct floating position
...
If the title bar has a single dock widget and you press the float
button, then use the DockWidget's "last floating position" to
position the new floating window
2020-05-22 11:37:52 +01:00
Sergio Martins
4917da9e7c
Minor: factorout some code into DockWidget::saveLastFloatingGeometry()
2020-05-22 11:37:25 +01:00
Sergio Martins
6d44362991
DockWidget::setFloating(true): restore to previous floating position
...
When floating a dock widget we restore it to the last known floating
position now
2020-05-22 11:12:12 +01:00
Sergio Martins
b3b25ba047
Save the last floating geometry right before docking
...
Previously it was only saved on close(), which isn't enough
2020-05-22 11:01:31 +01:00
Sergio Martins
76ba261f62
Return LastPositions by reference
...
Otherwise we're calling setters on a temporary
2020-05-22 10:53:37 +01:00
Sergio Martins
d9184e2396
debug++
2020-05-21 20:07:09 +01:00
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