Commit Graph

1069 Commits

Author SHA1 Message Date
Sergio Martins
98e47856f3 tests: Simply getting the drop area
No need for casts
2019-07-17 21:32:45 +01:00
Sergio Martins
8b0c3e6953 Simplify Frame::isInMainWindow() 2019-07-17 21:24:41 +01:00
Sergio Martins
3a4a46c291 Simplify Item::isInMainWindow() 2019-07-17 21:23:48 +01:00
Sergio Martins
887806efbe Move isInMainWindow to base class 2019-07-17 21:23:48 +01:00
Sergio Martins
f98ca37651 Add more margin to title when there's no icon 2019-07-17 18:58:59 +01:00
Sergio Martins
eb5c7b357d Merge pull request #6 from Montel/add_icon_tabwidget
Add icon on tabwidget
2019-07-17 18:55:42 +01:00
Sergio Martins
16e99dac8b Fix rectForDrop() when one of the sides didn't have more space
The layout guarantees that there's enough space for the widget
and for the new anchor, but doesn't say in which side the new
anchor should steal space from, so bound the rect when we finish
calculating it

Finally we can uncomment the warning in Anchor::setPosition() to
detect out of bounds cases, tests pass now with no warning
2019-07-17 17:59:20 +01:00
Sergio Martins
0630da9687 Minor rename 2019-07-17 16:48:43 +01:00
Laurent Montel
bc574449e3 Add icon on tabwidget 2019-07-17 17:25:25 +02:00
Sergio Martins
e3f49653c3 Fix typo in rectForDrop(), found by unit-test 2019-07-17 15:47:47 +01:00
Sergio Martins
4d07364d85 Add more margin to the icon 2019-07-17 15:13:23 +01:00
Sergio Martins
6d82834aee Always paint the Frame when it's docked, looks nicer
We can eventually make this stylable too
2019-07-17 15:05:52 +01:00
Sergio Martins
6d5116f7cf tests++ 2019-07-17 14:55:21 +01:00
Sergio Martins
f65fdef13e tests: More tests for rectForDrop() 2019-07-17 12:03:45 +01:00
Sergio Martins
8ad6843413 debug++ 2019-07-17 11:50:19 +01:00
Sergio Martins
9fe0a191eb Remove unneeded test, in the hope of removing MultiSplitterLayout::resizeItem()
which is not the correct way to resize items
2019-07-17 11:46:51 +01:00
Sergio Martins
fc380eab72 More tests for rectForDrop() 2019-07-17 11:46:42 +01:00
Sergio Martins
d0cd0df157 Make it easier to unit-test rectForDrop()
Just pass an int instead of the Item.
Made Length public.
2019-07-17 10:50:36 +01:00
Sergio Martins
da4b840ff4 Split rectForDrop() in two, so we can unit-test the second one
It has complex math
2019-07-17 10:36:51 +01:00
Laurent Montel
c0e08dd584 Add missing update() when changing icon 2019-07-17 09:57:45 +01:00
Sergio Martins
2b45aab88d Propagate closing events
FloatingWindow now asks Frame if it should close
Frame asks its DockWidgets
DockWidget asks its widget
2019-07-16 22:36:08 +01:00
Sergio Martins
0abc315584 Share some tests code in utils.cpp 2019-07-16 22:13:22 +01:00
Sergio Martins
cff487099d Add missing override 2019-07-16 21:39:51 +01:00
Sergio Martins
3c4dba77bf Add tests/utils.h
tst_docks.cpp is becoming too big
2019-07-16 21:38:45 +01:00
Sergio Martins
094dbf1390 Add a way to use the rubber band as top-level
Seeing artifacts when embedded in MFC
2019-07-16 19:52:41 +01:00
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