Commit Graph

258 Commits

Author SHA1 Message Date
Sergio Martins
2769c8a789 fuzzer: Fix serializing QRect and QSize 2019-10-11 15:09:24 +01:00
Sergio Martins
38619e734f fuzzer: dump to json when it fails 2019-10-11 14:18:20 +01:00
Sergio Martins
005e811eaa fuzzer: Fix hidding/showing operations
They werent receiving a dock widget name.
Normalized them, they now receive Fuzzer* via ctor
2019-10-11 13:33:13 +01:00
Sergio Martins
4d7da1e6f3 tests: Fix build
Fuzzer.cpp was filtered out by .gitignore
2019-10-11 13:27:13 +01:00
Sergio Martins
233d3f14cc fuzzer: AddDockWidget operation now works 2019-10-11 13:20:16 +01:00
Sergio Martins
e432c0d409 fuzzer: Move fuzzer into a fuzzer/ directory 2019-10-11 12:45:34 +01:00
Sergio Martins
16876695e3 fuzzer: Add an OperationType_AddDockWidget operation
fuzzer will have to be refactored before finishing it
2019-10-11 12:12:13 +01:00
Sergio Martins
1493ee6bb2 tests: Wait for FloatingWindow to be deleted when closing dockwidget 2019-10-11 11:41:35 +01:00
Sergio Martins
b20d0f0412 tests: Add missing include guards 2019-10-11 11:41:31 +01:00
Sergio Martins
a2e610ee4b tests: share waitForEvent() and waitForDeleted() 2019-10-11 11:38:21 +01:00
Sergio Martins
5fdf551907 fuzzer: Refactor operations a bit 2019-10-11 11:24:43 +01:00
Sergio Martins
0322dcf553 fuzzer: Chose the dock widget to run the operation on 2019-10-11 09:01:29 +01:00
Sergio Martins
e530170753 fuzzer: Randomize operations too 2019-10-11 08:53:51 +01:00
Sergio Martins
0b24cf70c2 fuzzer: Fail if there's a warning 2019-10-11 08:48:20 +01:00
Sergio Martins
83625bdda3 tests: Move the qDebug filter to Testing.h
So it can be shared with the fuzzer
2019-10-11 08:46:51 +01:00
Sergio Martins
d01c8ac646 tests: Initial implementation of the fuzzer
Also the Testing now has some sort of framework for so anyone can
write tests easier in the future. Still wip.
2019-10-09 18:35:04 +01:00
Sergio Martins
c0d8b8e083 Remove the old fuzzer, we're doing an overhaul 2019-10-09 15:36:43 +01:00
Sergio Martins
ac313c5a24 Don't save floating geometry on clear()
clear() shouldn't save anything.
Fixes floating dockwidgets not having proper geometry when shown
after clear() was called.
2019-10-08 14:59:31 +01:00
Sergio Martins
58e90bd7c4 Make MainWindow_None the default, instead of MainWindow_HasCentralFrame
Central Frame is the old Qt way. With KDDockWidgets everwhere
is fair game to dock and undock.
2019-10-07 14:02:30 +01:00
Sergio Martins
a0d05b4e2b Move Frame::Options enum to KDDockWidgets.h
So we can forward declare Frame and not include private headers
in FrameworkWidgetFactory.h
2019-10-07 13:43:48 +01:00
Sergio Martins
21579f2743 Minor method renames 2019-10-07 00:16:16 +01:00
Sergio Martins
c5149ab13c Fix title bar being visible with Flag_HideTitleBarWhenTabsVisible
Frame::updateTitleBarVisibility() was bailing out early. That
guard looks like some leftover, m_dropArea isn't even dereferenced
there, so just remove the guard.
2019-09-30 11:00:38 +01:00
Sergio Martins
8df3eddd9b Fix crash when trying to drag a single tab
and the tab was in a floating window and we were using "TabsAlwaysVisible"
2019-09-12 17:22:29 +01:00
Sergio Martins
254dde64c7 Tests++ 2019-09-12 15:58:17 +01:00
Sergio Martins
9ef006bce4 tests++ 2019-09-12 15:50:11 +01:00
Sergio Martins
370780cf22 Don't run the sanity checks during a restore
During a restore the layout is in an intermediate state, so we're
not suppose to do such tight checks.
2019-09-10 19:41:39 +01:00
Sergio Martins
abbc79f0e0 Progress with the QtQuick port 2019-09-07 16:20:22 +01:00
Sergio Martins
76640d16b3 Fix support static separators with 0 thickness 2019-09-02 11:26:57 +01:00
Sergio Martins
9f7969bfc3 Tests now pass with static anchor thickness > 2
Still need to fix with =0
2019-09-02 11:07:58 +01:00
Sergio Martins
8cb34e4d65 tests: Fix tst_rectForDrop() with variable static anchor thickness 2019-09-02 10:56:48 +01:00
Sergio Martins
5caca65843 Fix test that didn't support static anchor thickness != 1 2019-09-02 10:52:03 +01:00
Sergio Martins
7797599b5d Fix unit-tests when separator thickness is even 2019-09-01 19:04:37 +01:00
Sergio Martins
30135acbd0 tests: Remove hardcoded anchor thicknesses 2019-09-01 15:03:04 +01:00
Sergio Martins
46a5a580bc Add LayoutSaver::restoredDockWidgets()
Implemented as a property it's better that the LayoutSaver
doesn't carry state about this. Then we would need to remove dock
widgets from the list if they are deleted. Also not a important
enough feature to be on the DockWidget public interface.
2019-08-28 17:56:18 +01:00
Sergio Martins
f0078c3649 Fix dragging window by title bar when using document mode
When using document mode the click goes to the tab bar, not the
tab widget
2019-08-28 17:05:45 +01:00
Sergio Martins
59cdadf386 Add DockWidgetBase::titleBar() 2019-08-24 22:55:06 +01:00
Sergio Martins
9e9ca66382 Call ensureAnchorsBounded() directly in setSize()
No need for it to be scattered in random places.
Also, don't warn in Anchor::setPosition() if we're in the middle
of a resize, ensureAnchorsBounded() will be called soon.
2019-08-20 18:19:20 +01:00
Sergio Martins
ecf1b61f22 Respond immediatley to min size changes
instead of waiting for LayoutRequests from the main window
which can be async.
2019-08-20 17:48:55 +01:00
Sergio Martins
7a91fb5310 tests: Add more checkSanity() 2019-08-19 22:50:27 +01:00
Sergio Martins
9f544975f1 Support existing widget's minSize changing
previously we only honoured the min size of when they were
added to the layout
2019-08-19 19:44:51 +01:00
Sergio Martins
dd58836ddf Fix another case of out of bounds anchor position
Happens because rectForDrop() is returning the rect without considering
the widget that we're adding, so doesn't respect the bounds.

Let's just ignore the out of bounds warning. ensureAnchorsBounded()
is ran at the end anyway so we're fine.
2019-08-19 19:26:54 +01:00
Sergio Martins
c6a8b236af Update the item's minimum size when restoring a placeholder 2019-08-13 14:08:08 +01:00
Sergio Martins
c1ea98825e Improve includes 2019-08-12 16:41:00 +01:00
Sergio Martins
cace480ff2 Add failing unit-test 2019-08-12 14:51:46 +01:00
Sergio Martins
776a0f78ed Rename contentsSize to size
When MultiSplitterLayout was a widget it made sence to have
a different name, but now anymore
2019-08-12 11:56:37 +01:00
Sergio Martins
3385b6c15c After restoring a placeholder we need to ensure all anchors are bounded
We only ensure the ones next to our item are bounded, but there can be
indirect ones that were holding items that now must shrink
2019-08-12 11:29:45 +01:00
Sergio Martins
b8de3aa21f TitleBar: Allow to makeWindow() even if it's not visible
The MainWindow can be hidden still.
Anyway, this won't be called if really invisible, the assert
is a bit tight.
2019-08-08 22:51:33 +01:00
Sergio Martins
74997d35c5 Add test that we can add to an hidden window 2019-08-08 22:45:33 +01:00
Sergio Martins
990e487fed rename name() to uniqueName() for readability 2019-08-08 22:30:29 +01:00
Sergio Martins
17b3048aeb cmake: Rename target to kddockwidgets instead of docks 2019-08-08 16:03:59 +01:00