Commit Graph

1282 Commits

Author SHA1 Message Date
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
Sergio Martins
86a2b14921 Move more code to GuestWidget 2020-05-23 21:14:11 +01:00
Sergio Martins
4fab2cf360 Move more code into GuestWidget 2020-05-23 20:11:27 +01:00
Sergio Martins
0a2fb6ed73 Add GuestWidget.h
The QtWidgets counter-part for GuestInterface.

Removing QWidget from Item
2020-05-23 19:22:01 +01:00
Sergio Martins
3d95263b40 Fix examples build with installed kddw 2020-05-23 19:00:12 +01:00
Sergio Martins
e75b47737c Move GuestInterface into its own file 2020-05-23 18:59:58 +01:00
Sergio Martins
9ad6eefa7a Add Layouting::Config
To host many of the scatered static member variables which
held some settings that rarely change
2020-05-23 18:40:20 +01:00
Sergio Martins
2527b39368 Moved the multisplitter wrapper outside of multisplitter/
As it depends on kddw framework, while multisplitter/ is the
agnostic layouting engine
2020-05-23 17:01:20 +01:00
Sergio Martins
71c7a7c9a9 Move more ItemContainer members to private 2020-05-23 16:46:43 +01:00
Sergio Martins
72c2586e20 Item: move a bunch of members to the private impl 2020-05-22 21:30:24 +01:00
Sergio Martins
7c5ed8bf84 Merge pull request #45 from OlivierJG/master
Fix include path so private header can be used
2020-05-22 20:30:51 +01:00
Olivier JG
70f0c49709 Fix include path so private header can be used 2020-05-22 14:17:02 -05:00
Sergio Martins
986a25971e Also print the widget geometry if it's different from the item 2020-05-22 15:56:02 +01:00
Sergio Martins
0c776b6595 Fix non-developer build 2020-05-22 12:26:21 +01:00
Sergio Martins
7a852f700f Save floating geometry right before starting a drag
so if you drop, then set floating again it goes to the original
floating position
2020-05-22 12:15:24 +01:00
Sergio Martins
bd848d8040 Add Draggable::singleDockWidget()
If the draggable only has a single dock widget, returns it.
Otherwise nullptr.
2020-05-22 12:14:12 +01:00
Sergio Martins
a7013b4cf7 Make DockWidget::setFloating(false) save the last docking position
so we can restore to it when floating again
2020-05-22 11:42:00 +01:00
Sergio Martins
8e39ce2dea When floating via titlebar, restore to correct floating position
If the title bar has a single dock widget and you press the float
button, then use the DockWidget's "last floating position" to
position the new floating window
2020-05-22 11:37:52 +01:00
Sergio Martins
4917da9e7c Minor: factorout some code into DockWidget::saveLastFloatingGeometry() 2020-05-22 11:37:25 +01:00