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
Sergio Martins
dab0694dbc
Introduce Anchor::findNearestAnchorWithItems()
...
As a cleaner alternative than abusing AnchorGroup::turnIntoPlaceholder()
as the item was already a placeholder
2019-07-10 19:11:10 +01:00
Sergio Martins
90502ae5c7
When adding widgets relative to placeholders don't forget to set following
2019-07-10 18:24:33 +01:00
Sergio Martins
91704fd486
Uncomment a few tests that are passing
2019-07-10 16:39:30 +01:00
Sergio Martins
ba0da2aab1
debug++
2019-07-10 16:27:09 +01:00
Sergio Martins
3f73a99a71
Update followers whenever the followee anchor is deleted
2019-07-10 16:10:30 +01:00
Sergio Martins
eb29f1318d
Minor rename
2019-07-10 15:57:18 +01:00
Sergio Martins
6134ccfd3c
Add MultiSplitterLayout::anchorsFollowing
2019-07-10 15:55:55 +01:00
Sergio Martins
fa23d954b1
Add a failing unit-test
2019-07-10 15:34:13 +01:00
Sergio Martins
839500b84d
Fix detecting window when the top-level is embedded in MFC
...
Although topLevel is a topLevel to Qt, it's actually inside
another Windows window.
2019-07-10 15:33:07 +01:00
Sergio Martins
2cbf758f6b
Don't include MainWindow.moc in .cpp
...
some build systems don't support it
2019-07-10 12:58:24 +01:00
Sergio Martins
bad105f0a2
Dont' accept using AddingOption_StartHidden for any layouted dock widgets
2019-07-10 12:31:10 +01:00
Sergio Martins
b8d5fefbf1
Allow to add a dock widget directly as a placeholder
...
So it's not visible at startup if not needed
2019-07-10 12:24:36 +01:00