Commit Graph

1300 Commits

Author SHA1 Message Date
Sergio Martins
d07f715ed7 updateTitleBarVisibility after deserializing
Fixes floating window having two title bars
2020-05-26 21:53:51 +01:00
Sergio Martins
87c7a8ad65 Add unit-test for the previous commit 2020-05-26 20:17:37 +01:00
Sergio Martins
05f93a98f0 LayoutSaver: Only close dock widgets that would be restored
It can happen that the JSON layout knew about less dock widgets
than there are, as there can be new ones now
2020-05-26 19:49:02 +01:00
Sergio Martins
bab10c8d65 Add overloads to DockRegistry::clear()
So we can specify what to close
2020-05-26 19:13:34 +01:00
Sergio Martins
5e3a305a7c Add some useful DockRegistry overloads 2020-05-26 18:58:04 +01:00
Sergio Martins
c9fa637ae7 Add some helper methods to LayoutSaver::Layout
To retrieve the list of main windows and dock widgets present
in the loaded layout
2020-05-26 18:29:30 +01:00
Sergio Martins
79064b539a Another amalgamation fix 2020-05-26 16:16:31 +01:00
Sergio Martins
aa7107bde2 Silence some warnings on Windows 2020-05-26 16:13:56 +01:00
Sergio Martins
704e6d0182 Fix the amalgamation build a bit
As Config is already in another namespace
2020-05-26 16:12:25 +01:00
Sergio Martins
7634438f6c Add unit-test to previous commit 2020-05-25 23:30:31 +01:00
Sergio Martins
314cd6649d Item: also emit numVisibleItemsChanged when inserting a container
Since it can have items inside too
2020-05-25 23:27:13 +01:00
Sergio Martins
e08a7a6725 Fix tst_lastFloatingPositionIsRestored when there's a frame
Otherwise only passes on offscreen qpa which has no frame
2020-05-25 22:19:05 +01:00
Sergio Martins
45d5d7b519 update .gitignore 2020-05-25 21:47:03 +01:00
Sergio Martins
63c90875aa example: Add example of docking main window into main window 2020-05-25 21:45:21 +01:00
Sergio Martins
ee4ad02722 Fix FloatingWindow::hasSingleFrame()
Use m_dropArea->numFrames() which happens first, otherwise there
can be a moment where the frames() aren't updated yet
2020-05-25 21:43:01 +01:00
Sergio Martins
cd1f52a4bb When looking for drop target honour affinity 2020-05-25 21:29:29 +01:00
Sergio Martins
66a0959ac0 Honour main windows being nested in Frame::floatingWindow()
In such case the Frame is inside the nested main window, not floating.
2020-05-25 20:52:15 +01:00
Sergio Martins
39d70c8186 Fix crash due to recurency in DragController
A drop could cause the events to be processed and trigger
another mouse move

Fixes: #19
2020-05-25 20:48:18 +01:00
Sergio Martins
d541a41536 Minor refactoring, factor some code into a function 2020-05-25 20:40:02 +01:00
Sergio Martins
9761759fee Fix Floating window returning frames from nested main windows
Which we want to support now too
2020-05-25 20:27:08 +01:00
Sergio Martins
d4d83111ff Added DockWidgetBase::isMainWindow() 2020-05-25 20:25:33 +01:00
Sergio Martins
de09d5532f Fix DropArea::numFrames()
Was counting with placeholder items too. This should fix title bars
being wrong in some cases.
2020-05-25 20:12:29 +01:00
Sergio Martins
944138273f Tests: stabilize tst_embeddedMainWindow
Going 50px into the window was too short and didn't reach the embedded
window to show the indicators.

Also, it's the inner indicator we want, the other isn't visible as the
window is single frame
2020-05-25 20:11:01 +01:00
Sergio Martins
d2ca14bf99 DebugWindow: Also print affinities 2020-05-25 14:39:19 +01:00
Sergio Martins
84391c693c DebugWindow: Remove duplicate dump debug button
And the second one was incomplete as it didn't dump for the
floating windows
2020-05-25 14:31:21 +01:00
Sergio Martins
d94263fce5 Allow each dock widget and main window to support multiple affinities 2020-05-25 14:14:17 +01:00
Sergio Martins
2fd9d45525 Link multisplitter as a PUBLIC dependency if kddockwidgets
This way user doesn't need to explicitly link against it
2020-05-25 06:52:25 +01:00
Sergio Martins
8461f1f79e kddockwidgets_multisplitter is now a library of its own 2020-05-25 06:45:13 +01:00
Sergio Martins
d9badf3ffd Fix build 2020-05-25 06:10:18 +01:00
Sergio Martins
1ece0f0fef Add a fwd header for Separator_qwidget.h
Makes QtC happy with editing the example
2020-05-24 20:54:25 +01:00
Sergio Martins
4af582a21f Update .gitignore 2020-05-24 20:53:52 +01:00
Sergio Martins
ab90da3b19 Readability: Rename Item::guest() and Item::widget()
Their name wasn't matching their return value
2020-05-24 20:52:23 +01:00
Sergio Martins
45f4d9f6a8 Item no longer depends on QWidget 2020-05-24 20:47:58 +01:00
Sergio Martins
ba49e1cbe2 Separator no longer inherits from QWidget
Only SeparatorWidget does
2020-05-24 20:29:49 +01:00
Sergio Martins
c67f1c28f6 Fix build 2020-05-24 20:23:07 +01:00
Sergio Martins
de0bcf9ce3 readability: Rename asWidget() to asQWidget() 2020-05-24 20:03:02 +01:00
Sergio Martins
3bbc33d8c4 example: Revive the custom separator example
Pass -p to see a custom painted separator
2020-05-24 19:31:15 +01:00
Sergio Martins
e8abc23f59 Use a dedicated export macro file for multisplitter/
As it's independent from KDDW
2020-05-24 19:24:16 +01:00
Sergio Martins
c63c713bea Move SeparatorWidget into multisplitter/
multisplitter/ is to be a reusable component without needing KDDW
2020-05-24 19:13:39 +01:00
Sergio Martins
c33c7ab450 Don't leak Layouting::Widget
Don't create it directly, instead of multi-inheritance
2020-05-24 18:45:44 +01:00
Sergio Martins
c31edd0cd8 Remove a stray qDebug 2020-05-24 18:30:56 +01:00
Sergio Martins
b395b96234 Fix tst_multisplitter leaks
The Widget wrapper was leaking
2020-05-24 18:30:07 +01:00
Sergio Martins
16aac70510 Make MultiSplitter inherit from Layouting::Widget too
Since it's the host widget.
Fixes the Widget wrapper leaking. And no need for so much boiler-plate
2020-05-24 18:25:19 +01:00
Sergio Martins
7c9ee4f497 Move the mouse handling from Separator to SeparatorWidget
As it's QWidget specific
2020-05-24 17:58:04 +01:00
Sergio Martins
7f49f6e6a4 Move the separator's rubber band into SeparatorWidget
as it's specific to QWidget
2020-05-24 17:49:14 +01:00
Sergio Martins
c477fce1d9 Add Widget::show(), hide() and setGeometry() 2020-05-24 17:43:54 +01:00
Sergio Martins
e28f82dcad Make Item::hostWidget be a Layouting::Widget instead of QWidget
Just an abstraction preparing for QQuickItem support
2020-05-24 17:31:37 +01:00
Sergio Martins
7016656264 Rename GuestInterface to Widget
So we can use it to abstract the host too, not just the guest.
2020-05-24 15:23:10 +01:00
Sergio Martins
7f981a1d1d Item cleanup, moved LengthOnSide to impl 2020-05-24 14:05:04 +01:00
Sergio Martins
94b4051e31 Fix namespace build 2020-05-24 13:57:17 +01:00