Commit Graph

1069 Commits

Author SHA1 Message Date
Sergio Martins
78da67264a Remove unneeded qDebug 2019-07-15 09:55:26 +01:00
Sergio Martins
c96eb88023 Fix choosing which anchors to move when restoring placeholders 2019-07-15 00:16:58 +01:00
Sergio Martins
9766fbcb3b Fix typo 2019-07-14 21:39:51 +01:00
Sergio Martins
0aac8edb0c Fix off by ones in rectForDrop()
It was accounting for the anchor thickness
2019-07-14 21:39:11 +01:00
Sergio Martins
3633007326 Add some commented out code for more sanity checks
Not all tests pass yet with these strict checks, so commented out
for now
2019-07-14 21:37:55 +01:00
Sergio Martins
1108781277 Don't resize anchors on layouts that are being destroyed
When dropping a MultiSplitter into a MultiSplitter there's an instant
where some anchors of the group are from the source MultiSplitter
as they weren't consumed yet
2019-07-14 21:14:14 +01:00
Sergio Martins
60b9007632 Add Item::minimumSize property for gammaray 2019-07-14 21:12:54 +01:00
Sergio Martins
d05c1adcd7 tests: Allow EventFilter wait for any event 2019-07-14 20:14:42 +01:00
Sergio Martins
151714d9e0 Added sanity check for static anchors positions 2019-07-14 19:27:41 +01:00
Sergio Martins
c1563b6f86 Fix bug where widget didn't have the correct size after restored
Because the anchor already had the correct position it wouldn't
update the widget size
2019-07-14 18:32:19 +01:00
Sergio Martins
fc7078bf6e Add sanity checks for item geometry
The item geometry has to be the same as the area of the enclosing
anchors
2019-07-14 17:11:27 +01:00
Sergio Martins
5fe3d72732 Clean windows at end of test 2019-07-14 17:07:57 +01:00
Sergio Martins
320556c775 Add a failing unit-test
The widget isn't being resized
2019-07-14 16:56:13 +01:00
Sergio Martins
f02b40a028 Add AnchorGroup::itemSize 2019-07-14 16:55:19 +01:00
Sergio Martins
e30d6ecf8d fuzzer: escape strings 2019-07-14 14:24:07 +01:00
Sergio Martins
5ef4ae6314 Remove unneeded isPlaceholder check
minLength() already checks for that
2019-07-14 14:21:55 +01:00
Sergio Martins
c7f0eb704a Abstract widgets min sizes behind Item
The layout now only consults Item for the min size, never
the widgets directly. The reason is Item in the future will have
to detect the widget's min size changing, so it's better encapsulated
this way. Also decouples the layout from QWidget a bit, so in the future
we can support QML

The direct consequence is fixing the warnings about size constraints
not being honoured, due to widget getting different min size and we not
resizing
2019-07-14 14:20:11 +01:00
Sergio Martins
353dc4474c Fix restoring a floating window in some cases
MultiSplitterLayout::unrefOldPlaceholders() was clear all placeholder
references for that dock widget, but when using addMultiSplitter()
we don't create a new Item, we just steal the Items from the source
multi splitter, so we need to preserve those refs

Added unit-test
2019-07-14 13:08:24 +01:00
Sergio Martins
8fdb6fb5de Improve failing test 2019-07-13 13:39:43 +01:00
Sergio Martins
8d2206c137 Add a comment 2019-07-13 12:59:59 +01:00
Sergio Martins
f55f90e575 Remove wrong assert, the Item can be still being refed by other widgets
Like dock widgets that where set floating and remember their previous
positions. The item will only be deleted if refcount is 0
2019-07-13 12:57:06 +01:00
Sergio Martins
bb59b3bedb Add a failing test 2019-07-13 12:45:53 +01:00
Sergio Martins
0a70fb20ea Remove unneeded qDebug 2019-07-13 12:33:56 +01:00
Sergio Martins
ef2f9ca569 Remove unneeded qDebug 2019-07-13 12:31:57 +01:00
Sergio Martins
2cbd6f5dbb cmake: Don't look for X11Extras on Windows 2019-07-13 12:11:32 +01:00
Sergio Martins
bcd44d5408 Build with QT_NO_KEYWORDS 2019-07-13 12:09:17 +01:00
Sergio Martins
105bb6770b Add a failing test for a feature we don't support yet
When adding a dock widget to a tab we don't check its minimum size
and we don't resize the layout, yet.
2019-07-13 03:01:53 +01:00
Sergio Martins
8a69fce26a Remove some unused code 2019-07-13 02:45:12 +01:00
Sergio Martins
fa5f03c0a2 Add missing include 2019-07-13 02:45:00 +01:00
Sergio Martins
cd96c63ddf Merge pull request #3 from Montel/remove_unused_includes
Remove unused includes
2019-07-13 02:39:27 +01:00
Sergio Martins
5071c2befe Merge pull request #2 from Montel/remove_duplicate_logging_p_h
Remove duplicate logging_p.h
2019-07-13 02:38:48 +01:00
Sergio Martins
7709803e57 Make the setFollowee() stuff much simpler
It was getting quite crazy to figure out which anchors to follow
when restoring dock widgets in complex layouts full of hidden items.

Now, the approach is much simpler, we just call setFollowee(nullptr)
on all anchors, then swipe left and right, top and bottom and
set the anchors that really need to follow
2019-07-12 12:58:11 +01:00
Sergio Martins
abafa49492 fuzzer: minor style fixes and add Laurent as author 2019-07-12 11:20:15 +01:00
Sergio Martins
7c3a5f83e5 Merge pull request #1 from Montel/add_fuzzer_apps
Add test application for generating random dockwidget for testing potential bugs
2019-07-12 11:16:41 +01:00
Laurent Montel
122f5dcebe Remove unused includes 2019-07-12 12:07:40 +02:00
Laurent Montel
b57588364b Remove duplicate logging_p.h 2019-07-12 12:04:12 +02:00
Laurent Montel
30a04e1d13 Add test application for generating random dockwidget for testing potential bugs 2019-07-12 11:57:20 +02:00
Sergio Martins
f0e9a4f1bc Add another failing test 2019-07-11 14:10:25 +01:00
Sergio Martins
b4864d156f Don't assert that the group is squashed
It can happen
2019-07-11 14:02:11 +01:00
Sergio Martins
7561047fa5 Relax sanity checks for placeholder items
We don't care about their size
2019-07-11 14:00:58 +01:00
Sergio Martins
1a06cb3757 Update the thickness when the end followee changes 2019-07-11 13:12:41 +01:00
Sergio Martins
e5fbbdae6c Improve finding the right anchors for restoring placeholders 2019-07-11 12:58:35 +01:00
Sergio Martins
898c27291b Refactor 2019-07-11 11:36:37 +01:00
Sergio Martins
48366ff847 Refactor a bit 2019-07-11 11:19:30 +01:00
Sergio Martins
9f706a0abd Add AnchorGroup::availableSize() 2019-07-11 11:12:52 +01:00
Sergio Martins
5d9e827d21 Add MultiSplitter::ensureAvailableSize() 2019-07-11 11:04:33 +01:00
Sergio Martins
e7deb2c27a Add MultiSplitterLayout::availableSize()
Just an overload to methods we already have
2019-07-11 10:35:27 +01:00
Sergio Martins
59a01e7d2d Asserts++ 2019-07-11 10:35:05 +01:00
Sergio Martins
6116c4c11b Remove AnchorGroup::anchorFollowing
It's now unused and technically wrong as there can be more than 1
following in the same group
2019-07-11 10:16:09 +01:00
Sergio Martins
8503bca997 Add anchorsFollowingInwards()
To replace anchorFollowing(), as there can be more than 1
2019-07-11 10:09:36 +01:00