Sergio Martins
ba2fdfc46c
Fix tests with 5.9
...
There was just 1 failing, which needed higher margins
2020-06-23 22:11:50 +01:00
Sergio Martins
a8bd46155c
Fix typo in test
2020-06-23 19:24:00 +01:00
Sergio Martins
da4b90e373
tests: Use different json filenames
...
So tests can run in parallel
2020-06-23 19:01:13 +01:00
Sergio Martins
91b291a1a9
tests: Tests now run 10x faster, with ctest -j10 or so
...
Introduced an indirection, tests_launcher, which can run a subset
of the 140 tests, this way it's paralelizable by ctest
2020-06-20 15:27:58 +01:00
Sergio Martins
744f351c4e
Fix highlight when widget has QSizePolicy::Maximum
...
Multisplitter::rectForDrop() was only using QWidget::maximumSize(),
which doesn't need to be set. Also fix the case where the dropped widget
be a complete multisplitter
2020-06-17 18:04:59 +01:00
Sergio Martins
e5c0316ebb
Fix the highlight/rubber-band size not matching the size the item gets
...
Not all code-paths were using FairButFloor. Dropping a single item
used FairButFloor, but not when dropping another multi-splitter (
Layout with nested items)
2020-06-16 22:34:18 +01:00
Sergio Martins
25dd149475
Add Widget::mapToGlobal()
2020-06-13 19:09:44 +01:00
Sergio Martins
163b194398
Fix clang build, mostly shadowing warnings
2020-06-11 17:00:54 +01:00
Sergio Martins
86e58dd8a7
Merge MultiSplitterLayout into MultiSplitter
...
No need to have two. It's a leftover from the old layouting engine
2020-06-11 16:34:28 +01:00
Sergio Martins
7f9d160658
Also honour QSizePolicy::Maximum
...
It's yet another way to say you want a max size
2020-06-07 20:14:50 +01:00
Sergio Martins
daa220d513
tests: let the widget receive a size hint
2020-06-07 20:01:37 +01:00
Sergio Martins
d5797a3aea
Honour QSizePolicy::Fixed too
...
Some widgets, for example QPushButton, instead of having an explicit max size,
they communicate the need for a max size through their size policy
2020-06-07 19:53:06 +01:00
Sergio Martins
dabfeeaf3b
Honour max-size when floating a window
2020-06-05 15:35:55 +01:00
Sergio Martins
296889cace
Move TabWidget usage to FrameWidget
...
Frame is abstract and doesn't care about such implementation details.
QQuick will role out their own QTabWidget equivalent. No need to
abstract tab widget too, it's overkill.
2020-06-04 09:57:59 +01:00
Sergio Martins
ecfa43f801
Decouple TabWidget from Frame
...
TabWidget is now an implementation detail of FrameWidget.
QQuick will roll their own stuff with similar api, but no need to
abstract QTabWidget and QTabBar
2020-06-03 22:18:44 +01:00
Sergio Martins
0a75d89848
Add Frame::detachTab()
...
The tab widget will be an implementation detail of FrameWidget and
not accessed by anyone
2020-06-03 21:18:38 +01:00
Sergio Martins
4e88b3742d
Honour max-size when docking
...
Layout will choose a suitable size for the dock widget when
addDockWidget() is called
2020-05-29 09:53:51 +01:00
Sergio Martins
a086713bb6
Implement FrameWidget::maxSizeHint()
2020-05-29 08:11:42 +01:00
Sergio Martins
6797d291b6
Propagate max-size from the guest widget to DockWidget
...
Next step is propagating from DockWidget->Frame
2020-05-28 18:40:55 +01:00
Sergio Martins
4e3197388e
Add a failing TestDocks::tst_maxSizePropagates
2020-05-28 17:47:57 +01:00
Sergio Martins
d07f715ed7
updateTitleBarVisibility after deserializing
...
Fixes floating window having two title bars
2020-05-26 21:53:51 +01:00
Sergio Martins
87c7a8ad65
Add unit-test for the previous commit
2020-05-26 20:17:37 +01:00
Sergio Martins
7634438f6c
Add unit-test to previous commit
2020-05-25 23:30:31 +01:00
Sergio Martins
e08a7a6725
Fix tst_lastFloatingPositionIsRestored when there's a frame
...
Otherwise only passes on offscreen qpa which has no frame
2020-05-25 22:19:05 +01:00
Sergio Martins
63c90875aa
example: Add example of docking main window into main window
2020-05-25 21:45:21 +01:00
Sergio Martins
de09d5532f
Fix DropArea::numFrames()
...
Was counting with placeholder items too. This should fix title bars
being wrong in some cases.
2020-05-25 20:12:29 +01:00
Sergio Martins
944138273f
Tests: stabilize tst_embeddedMainWindow
...
Going 50px into the window was too short and didn't reach the embedded
window to show the indicators.
Also, it's the inner indicator we want, the other isn't visible as the
window is single frame
2020-05-25 20:11:01 +01:00
Sergio Martins
d94263fce5
Allow each dock widget and main window to support multiple affinities
2020-05-25 14:14:17 +01:00
Sergio Martins
ab90da3b19
Readability: Rename Item::guest() and Item::widget()
...
Their name wasn't matching their return value
2020-05-24 20:52:23 +01:00
Sergio Martins
45f4d9f6a8
Item no longer depends on QWidget
2020-05-24 20:47:58 +01:00
Sergio Martins
ba49e1cbe2
Separator no longer inherits from QWidget
...
Only SeparatorWidget does
2020-05-24 20:29:49 +01:00
Sergio Martins
de0bcf9ce3
readability: Rename asWidget() to asQWidget()
2020-05-24 20:03:02 +01:00
Sergio Martins
c31edd0cd8
Remove a stray qDebug
2020-05-24 18:30:56 +01:00
Sergio Martins
16aac70510
Make MultiSplitter inherit from Layouting::Widget too
...
Since it's the host widget.
Fixes the Widget wrapper leaking. And no need for so much boiler-plate
2020-05-24 18:25:19 +01:00
Sergio Martins
e28f82dcad
Make Item::hostWidget be a Layouting::Widget instead of QWidget
...
Just an abstraction preparing for QQuickItem support
2020-05-24 17:31:37 +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
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
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
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
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
6de5860e9a
Don't allow to drop to itself when having mainwindow inside dock widget
2020-05-20 16:33:48 +01:00
Sergio Martins
af22e3e12d
Fix tst_raise on XCB
2020-05-19 13:44:01 +01:00
Sergio Martins
9e198917f0
Try to recover from loading an invalid layout
2020-05-19 12:35:33 +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
d44a6f78b8
Fix build with older Qt
2020-05-14 21:10:46 +01:00
Sergio Martins
550d84ab11
Rename for readability
2020-05-10 22:26:40 +01:00