Commit Graph

944 Commits

Author SHA1 Message Date
Sergio Martins
5c97e9168a Fix build without developer build
LayoutSaver is also using those methods, it's not just the tests
2019-07-19 13:48:42 +01:00
Sergio Martins
cbef097bec Improve MultiSplitterLayout::clear()
To be used by LayoutSaver before restoring
2019-07-19 12:18:46 +01:00
Sergio Martins
963e566cda Ensure test doesn't leave windows open 2019-07-19 11:57:47 +01:00
Sergio Martins
63b016a1ad Remove a c-style cast 2019-07-18 23:12:34 +01:00
Sergio Martins
9628a6f66c Add Anchor::clear() 2019-07-18 23:12:21 +01:00
Sergio Martins
48ae1b5feb Add some simplifications 2019-07-18 22:30:17 +01:00
Sergio Martins
c430d40b0b Uncomment test that passes now 2019-07-18 22:04:48 +01:00
Sergio Martins
f5c005d412 LayoutSaver: Prevent Anchors from resizing items while constructing
the layout is still incomplete so don't resize anything. Instead, serialize
the geometry too, and set that when restoring.
2019-07-18 21:12:56 +01:00
Sergio Martins
21e54d0827 LayoutSaver: Make some methods private 2019-07-18 20:52:35 +01:00
Sergio Martins
5a63f23c6c Improve comment 2019-07-18 19:03:56 +01:00
Sergio Martins
380ae099ab LayoutSaver: Also serialize/deserialize Anchor::followee 2019-07-18 18:59:05 +01:00
Sergio Martins
ec2b00afa9 Merge pull request #7 from Montel/remove_double_deletion
Fix double deletion when we click on restore layout
2019-07-18 18:46:07 +01:00
Sergio Martins
e5086ded9b Merge pull request #8 from Montel/remove_double
Remove double ;
2019-07-18 09:29:57 +01:00
Laurent Montel
0f6a9fe270 Remove double ; 2019-07-18 10:20:27 +02:00
Laurent Montel
ad6fccc7fa Fix double deletion when we click on restore layout 2019-07-18 09:59:48 +02:00
Sergio Martins
2bbe3fbad4 Decouple from MultiSplitterWidget.cpp a bit 2019-07-17 23:19:31 +01:00
Sergio Martins
6e632e45ea Remove dead code 2019-07-17 23:07:16 +01:00
Sergio Martins
43eb94a9cc Remove some references to the multi splitter widget
It's size is always the same as contentSize
2019-07-17 23:06:36 +01:00
Sergio Martins
f6259430a7 Variable renaming for readability 2019-07-17 23:02:39 +01:00
Sergio Martins
ae5dc7d03e Rely less on parentWidget(), we know its type 2019-07-17 22:59:34 +01:00
Sergio Martins
0f2e34f147 Validate inputs before unrefing placeholders 2019-07-17 22:46:39 +01:00
Sergio Martins
521a065508 debug: Print the frame instead of just the address 2019-07-17 22:43:28 +01:00
Sergio Martins
9b5a0dc5be Make it easier to uncomment this code in the future
Introduce m_inCtor
2019-07-17 22:41:12 +01:00
Sergio Martins
af94a5da6d Added a needed debug to compare output between two shas 2019-07-17 22:11:18 +01:00
Sergio Martins
24dfb34a6f Less DropArea qobject_casts 2019-07-17 22:05:12 +01:00
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