Commit Graph

944 Commits

Author SHA1 Message Date
Sergio Martins
bb01676c4f Don't show the ClassicIndicators window, it's not needed
The rubberBand can be parented directly on the DropArea
2019-07-16 19:12:49 +01:00
Sergio Martins
6dcca66455 Add a way to know if any Separator is being dragged 2019-07-16 18:38:45 +01:00
Sergio Martins
7d25b27384 Downgrade two warnings to debug, as they can happen 2019-07-16 18:28:06 +01:00
Sergio Martins
5c3814893a Release mouse if button isn't pressed and Qt doesn't know about it
Can happen if Qt isn't driving the event pump and someone else handles
the release. Observed in an MFC app.
2019-07-16 18:25:41 +01:00
Sergio Martins
fa005e7b24 Don't move the separators in case the mouse isn't pressed
It can happen that someone else ate the ReleaseEvent
2019-07-16 15:08:50 +01:00
Sergio Martins
5054fd7be3 Allow an Item to restore a full frame instead of single dock widget
For the case where we have a floating frame with multiple tabs,
instead of restoring all individual dockwidgets one by one we
can simply restore the whole frame
2019-07-16 14:47:13 +01:00
Sergio Martins
007f483069 Support re-docking a frame with multiple dock widgets 2019-07-16 14:42:43 +01:00
Laurent Montel
010958d8ca Add support for doubleclick on titlebar 2019-07-16 12:17:07 +01:00
Sergio Martins
3bb80a18ef Fix unininitialized variable valgrind warning 2019-07-16 12:10:15 +01:00
Sergio Martins
b6c0353f7b Fix anchor following not being updated when an item is removed 2019-07-16 11:54:20 +01:00
Sergio Martins
4a0bd209b8 Fix ASSERT in Anchor::setFollower() 2019-07-15 23:44:35 +01:00
Sergio Martins
b314190ad1 Fix typo in assert, we want to validate the argument 2019-07-15 23:28:47 +01:00
Sergio Martins
a848810239 Add a failing test 2019-07-15 23:19:03 +01:00
Sergio Martins
8a6758c93d Fix buggy Anchor::findNearestAnchorWithItems()
It was returning inside the loop, instead of honouring the candidate
2019-07-15 22:46:27 +01:00
Sergio Martins
0eb746ad22 Uncomment test that passes 2019-07-15 20:12:27 +01:00
Sergio Martins
1cdf9e1c9a Add unit-test for checking that widgets preserve position after restored 2019-07-15 16:57:40 +01:00
Sergio Martins
0d4ef49571 Fix a cosmetic off-by-one when restoring a dock widget
now it appears at the same place
2019-07-15 16:07:56 +01:00
Sergio Martins
5979158441 When hidding a dock widget, distribute the size equally on both sides
Instead of only stealing space from 1 anchor
2019-07-15 14:36:54 +01:00
Sergio Martins
b19319935b Add AnchorGroup::outterGroup() 2019-07-15 13:51:39 +01:00
Sergio Martins
bacca2bc49 Minor refactor 2019-07-15 13:25:06 +01:00
Sergio Martins
9c0baea108 Add the fuzzer to .gitignore 2019-07-15 13:10:49 +01:00
Sergio Martins
8d31bb85fa Fix clazy warnings 2019-07-15 13:10:17 +01:00
Sergio Martins
3852fc2eb5 Don't show the floating button on FloatingWindow with nesting
Because we don't know where to put them back
2019-07-15 13:00:54 +01:00
Sergio Martins
dcbc7be0d9 Merge pull request #4 from Montel/add_icon_on_dockwidget
Add icon on DockWidget
2019-07-15 11:15:37 +01:00
Laurent Montel
9bf52e5ded Add icon on DockWidget 2019-07-15 12:10:23 +02:00
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