Commit Graph

1069 Commits

Author SHA1 Message Date
Sergio Martins
576da0f530 tests: Ensure tst_addAndReadd doesn't leave garbage behind 2019-06-25 20:01:45 +01:00
Sergio Martins
6436d17495 Add function availableLengthForOrientation 2019-06-25 19:59:51 +01:00
Sergio Martins
2a322005d0 Fix typos pointed out by krazy 2019-06-25 19:44:43 +01:00
Sergio Martins
7a6e9df2ed Add support for placeholders
So dock widgets remember their previous position so can be restored.
TODO: Support playing with dock widget visibility
2019-06-25 19:38:50 +01:00
Sergio Martins
0c9b27e213 Fix crashes pointed out by valgrind
The anchors were deleted by consume()
2019-06-24 18:16:50 +01:00
Sergio Martins
2f86d312f1 Fix crash when dereferencing Anchor after it was deleted 2019-06-24 18:08:16 +01:00
Sergio Martins
5dc6cec25e Fix some off-by-ones leading to top anchor having -1 position 2019-06-24 17:39:40 +01:00
Sergio Martins
ada118c66d Remove assert which is fine 2019-06-24 16:29:47 +01:00
Sergio Martins
2093d02ac5 Split the Anchor class in Anchor and SeparatorWidget
This way state is separated from the widget code, and a lot less
comples.
Anchor is now just a QObject, to be renamed to Separator.

Now the state drives the widget, before it was confusing, where
m_position was set when receiving move events.
2019-06-23 23:52:27 +01:00
Sergio Martins
a5ea350c5a Fix crash
The assert is too agressive, as the case is fine
2019-06-23 20:55:21 +01:00
Sergio Martins
64ed3a9ddf Remove duplicated logging category 2019-06-23 20:38:04 +01:00
Sergio Martins
f7941f75c1 Make itemForWidget() receive Frame* and rename it to itemForFrame()
So we can catch bugs at compile time
2019-06-23 17:22:56 +01:00
Sergio Martins
1e5db1ad4b Anchors: Assert that position is positive 2019-06-23 16:55:54 +01:00
Sergio Martins
5e218d843c Some renaming and const 2019-06-23 16:39:05 +01:00
Sergio Martins
eca39d0164 relativeTo is now a Frame* instead of QWidget*
As we only pass Frame*. This allows us to catch bugs at compile time.
2019-06-22 20:33:57 +01:00
Sergio Martins
1a36652ced Fix unit-tests
Borken after Item started accepting only Frame*
2019-06-22 20:22:02 +01:00
Sergio Martins
6a549db7fa Rename Item::widget() to Item::frame()
Since it returns a Frame, not only a QWidge
2019-06-22 19:06:58 +01:00
Sergio Martins
812ce6c29d tests: Silence some -Wweak-vtables warnings 2019-06-22 19:06:12 +01:00
Sergio Martins
3fe5eee9a9 Item: Deal in terms of Frame instead of QWidget
To catch errors at compile-time where we might be inserting
non Frames
2019-06-22 18:55:26 +01:00
Sergio Martins
9e5280c151 debug++ 2019-06-22 12:27:43 +01:00
Sergio Martins
5949fa8940 Remove unused Anchors enumerator 2019-06-22 10:41:15 +01:00
Sergio Martins
9632a906ab Remove unused class, this won't cover all the uses cases 2019-06-22 10:31:57 +01:00
Sergio Martins
3e884e800e Silence debug 2019-06-22 10:17:32 +01:00
Sergio Martins
dddf5f026a Remove unneeded qDebug 2019-06-22 01:11:52 +01:00
Sergio Martins
e8a81ba433 Rename some m_multiSplitter to m_layout 2019-06-22 00:30:49 +01:00
Sergio Martins
96cb4b8b07 Rename MultiSplitter to MultiSplitterLayout
As it's no longer a QWidget
2019-06-22 00:13:05 +01:00
Sergio Martins
e96b8cc262 Add a clazy exclude 2019-06-22 00:02:40 +01:00
Sergio Martins
1ac3238d4c Remove unneeded signal arguments 2019-06-22 00:00:54 +01:00
Sergio Martins
0d367994c7 separate MultiSplitter into MultiSplitter and MultiSplitterWidget
This factors out the layouting code into a non-QWidget class, so
it can be reused
2019-06-21 23:56:25 +01:00
Sergio Martins
e10f27ddfa MultiSplitter: Also pass which location and relativeTo was used 2019-06-21 19:32:14 +01:00
Sergio Martins
7c51969731 MultiSplitter: add widgetRemoved() signal
Just like we already have widgetAdded()
2019-06-21 19:11:11 +01:00
Sergio Martins
d44f0257ee Mark some methods as private 2019-06-21 18:55:59 +01:00
Sergio Martins
033179a82c Make LayoutMemory take DockWidget instead of QWidget 2019-06-21 16:30:07 +01:00
Sergio Martins
115fc87ad5 Move LayoutMemory to src/
While MultiSplitter is generic this one will know about DockWidget
2019-06-21 16:21:39 +01:00
Sergio Martins
10244c6e65 Add more checks to .clazy 2019-06-21 16:19:38 +01:00
Sergio Martins
bc69a32fe2 silence a clang-tidy warning about use after free 2019-06-21 13:19:38 +01:00
Sergio Martins
435ace202e clazy: pass a big type by ref and use qAsConst 2019-06-21 13:06:46 +01:00
Sergio Martins
0c521b5cf3 clazy: Add missing Q_OBJECT 2019-06-21 13:06:23 +01:00
Sergio Martins
e1ba281254 Silence some clazy warnings in the tests and examples 2019-06-21 13:05:28 +01:00
Sergio Martins
545d77c770 Silence krazy warning 2019-06-20 16:43:55 +01:00
Sergio Martins
cb0bc99285 cmake: Add -Werror -Wall -Wextra to gcc/clang
At least if DEVELOPER_MODE is enabled
2019-06-20 16:04:34 +01:00
Sergio Martins
77b2ed927d tests: Try to fix build on macOS 2019-06-20 15:55:02 +01:00
Sergio Martins
3fc57d0223 Add a LayoutMemory class, memory in the sense that it remembers
Needed for restoring widgets to their positions when made visible
again
2019-06-20 12:57:27 +01:00
Sergio Martins
25af853f2f Move some static functions into the global namespace 2019-06-19 23:00:43 +01:00
Sergio Martins
e99772fa4f Hide the frame whenever DockWidget::setVisible(false) is called 2019-06-19 17:03:21 +01:00
Sergio Martins
a77d86b6ad readability++ 2019-06-19 15:41:19 +01:00
Sergio Martins
566370eb32 readability: Renamed Frame::widgetCount() to Frame::dockWidgetCount()
dpcs++
2019-06-19 14:44:07 +01:00
Sergio Martins
41d75dd494 tests++ 2019-06-19 12:58:05 +01:00
Sergio Martins
17ddc03b3f Fix DockWidget::isTabbed() when it's in the central frame
The central frame always shows tabs
2019-06-19 11:24:13 +01:00
Sergio Martins
d047702e29 tests: Test redocking the frame before redocking the middle dock
The middle dock still finds its home.
2019-06-19 10:48:08 +01:00