Commit Graph

635 Commits

Author SHA1 Message Date
Sergio Martins
664798ee6e tests: Remove some asQWidget() calls 2022-04-13 22:28:04 +01:00
Sergio Martins
90bd78846a tests: Port away from a few Qt specific waitForEvent
Removes a bunch of asQWidget() from the tests
2022-04-11 15:14:51 +01:00
Sergio Martins
31db3d9562 Port away from QTest::qWaitForWindowActive, it's Qt specific
Simpliy moved it to Platform_qt
2022-04-11 11:37:31 +01:00
Sergio Martins
613a18f60c Delete operator== for ViewWrapper
Fixes a bug in the tests too
2022-04-10 20:47:33 +01:00
Sergio Martins
d6fd54cec4 Por all usages of QWindop/windowHandle to KDDockWidgets::Window
Removes a lot of asQWidget() code and is also prepared for non-Qt
views.
2022-04-09 19:21:56 +01:00
Sergio Martins
59f9824cc2 Fix typo during porting of test 2022-04-07 22:48:09 +01:00
Sergio Martins
71f0b644f2 Port away from including TitleBar_qtwidgets in tests 2022-04-07 22:43:56 +01:00
Sergio Martins
b60b54327b Port away from Item::guestAsQObject()
Use Item::guestView() instead.
2022-04-07 22:27:22 +01:00
Sergio Martins
0f2da43737 Rename guestWidget to guestView
As we deal in View now
2022-04-07 20:12:47 +01:00
Sergio Martins
558bd42447 tests: Remove more QWidget dependencies 2022-04-07 00:49:36 +01:00
Sergio Martins
7107bfe3e6 Remove _qtwidget include from utils.h 2022-04-07 00:40:25 +01:00
Sergio Martins
e593233b8f Renamed views_qtwidgets/ into qtwidgets/views/
As there will be some files that are specific to QtWidgets and
but aren't views
2022-04-03 23:51:02 +01:00
Sergio Martins
81e5d14e4f Cleanup DropArea and base classes re receiving QWidget
They receive View now
2022-04-03 23:19:53 +01:00
Sergio Martins
dcdd9333d4 Remove a bunch of asQWidget() calls 2022-04-02 15:34:38 +01:00
Sergio Martins
b6bc3810bd tests: Remove unneeded deletion of top-level windows
They are deleted automatically nowadays
2022-03-30 19:36:17 +01:00
Sergio Martins
15cb93ed43 Port away from Controller::window() returning a QWidget
It now returns a ViewWrapper, which is agnostic to QtWidgets
2022-03-30 19:30:18 +01:00
Sergio Martins
15601fc3c9 Split MainWindow into view/controller 2022-03-30 11:51:31 +01:00
Sergio Martins
9fba1e9799 Rename Controller::DockWidgetBase to Controller::DockWidget
As done for other controllers
2022-03-25 10:53:02 +00:00
Sergio Martins
8656108e81 Renamed MainWindowBase to MainWindow
As done for other controllers
2022-03-25 10:47:20 +00:00
Sergio Martins
63b5109113 Rename Views::MainWindow to Views::MainWindow_qtwidgets
As done for other views
2022-03-25 10:41:46 +00:00
Sergio Martins
264b08a731 Move MainWindow view into Views namespace 2022-03-25 10:40:16 +00:00
Sergio Martins
c6d95c42a8 Split most widgets into a Controller and a View
Controllers don't have any GUI and don't depend on the frontend
technology.

Views are implemented in a specific GUI tech (QtWidgets, QtQuick, etc).

For now only QtWidgets work. There's still a lot to decouple.

This will make it easier to introduce non-Qt backends.
2022-03-24 16:05:37 +00:00
Sergio Martins
2eeb4aac27 Fix Item_p.h being exposed in public API
Forward declare Item instead
2022-02-12 14:37:19 +00:00
Sergio Martins
4824a398ab Move DropIndicatorOverlayInterface::DropLocation enum to namespace scope
It's public now
2022-02-11 18:14:26 +00:00
Sergio Martins
4f8aac7df3 Fix floating windows not restoring to previous position
The dock widget wrapper that we deleted had that info. We need
to preserve it.
2022-02-04 16:57:44 +00:00
Sergio Martins
719803ecfa Fix a test with offscreen QPA
We were pressing on pos 6,6 to start a drag but that triggered
a window resize instead.
2022-02-04 16:10:13 +00:00
Sergio Martins
4f8b174a8d Fixed Frame::isFloating() for the nested MDI case 2022-02-04 15:17:11 +00:00
Sergio Martins
481dae64c3 nested_mdi: Fix floating windows not going back to their previous location
When floating a mdi window that was nested in a drop area, clicking the
float button should put it back to the MDI area.
2022-01-30 02:55:02 +00:00
Sergio Martins
721795b113 Remove LastPosition struct, move its members to Position
It was an unneeded indirection that didn't provide added semantics
2022-01-29 19:29:03 +00:00
Sergio Martins
d0dcac6b03 Make DockWidgetBase::setMDIPosition|setMDISize support nesting
They now honour Option_MDINestable.
Before they would bail out assuming they weren't in a MDI area.
Now they look further up the hierarchy to find our MDIArea, if any.
2022-01-25 20:14:04 +00:00
Sergio Martins
2b1aa44eff Fix crash when floating nested mdi 2022-01-24 19:18:55 +00:00
Sergio Martins
128645693c nested_mdi: Fix DnD over dock widgets docked in MDI
Dragging was always detecting the main window's drop indicator
overlay. Make it transparent for mouse events, so that
QWidget::childAt() doesn't pick it, and we can see the inner
drop areas.
2022-01-23 23:31:50 +00:00
Sergio Martins
86bceb4c48 nested mdi: Fix detaching inner dock widgets
Only the outter-most MDI frame is dragged in MDI mode. The inner ones
are dragged in normal docking mode, they become real floating windows.
2022-01-23 21:46:37 +00:00
Sergio Martins
ea64aae861 tests++ 2022-01-23 21:46:37 +00:00
Sergio Martins
d1645dff73 tests: Remove unneeded sleep 2022-01-23 21:46:37 +00:00
Sergio Martins
a72e018f3b nested mdi: Also test floating a nested MDI 2022-01-23 21:46:37 +00:00
Sergio Martins
18457d80aa nested mdi: Get rid of unneeded drop area mdi wrapper when floating
When floating, the FloatingWindow has its own DropArea for nesting.
We delete the redundant level of wrappers when floating.
2022-01-23 21:46:37 +00:00
Sergio Martins
9f6ec0244f nested mdi: More tests for closing docks 2022-01-23 21:46:37 +00:00
Sergio Martins
747e987f28 test++ 2022-01-23 21:46:37 +00:00
Sergio Martins
68e01c70ee nested mdi: Delete wrappers once we close the last nested DW 2022-01-23 21:46:37 +00:00
Sergio Martins
296b2a3370 nested mdi: Fix MDI's frame title not being updated
Before we didn't need to update it because there was only 1
dock widget. But now, if there's more than one we need to set the
application's name instead of the dock widget's name as title.
2022-01-23 21:46:37 +00:00
Sergio Martins
65ced9604f nested mdi: Fixed title bar visibility
When there's only one docked widget we only show 1 title bar.
Just like happens with a FloatingWindow
2022-01-23 21:46:37 +00:00
Sergio Martins
8c8f5a8fda Introduce Option_MDINestable
Should allow MDI dock widgets to also accept drops.
Befor, each MDI "window" only had 1 dock widget, but now each
MDI "window" a layout of dock widgets.

This is implemented by nesting the actual dock widget inside
a wrapper drop area. This drop area gives the drop support.

There's still bugs and more tests to fix before merging.
2022-01-23 21:46:37 +00:00
Allen Winter
2fbe4f872e Merge branch '1.5' 2022-01-20 08:15:23 -05:00
Allen Winter
93e60a743e update copyright year 2022-01-20 08:05:26 -05:00
Sergio Martins
37567d3980 Introduce MDIArea, a widget that can host MDI dock widgets
This is a public wrapper to MDILayoutWidget. The latter is private
and has internals we don't want to expose. Instead create a public
class with a thin API.

You no longer need to create a MainWindowMDI to have MDI support.
You can now have a normal MainWindow (with normal docking) and
add some dock widget that as a MDIArea as widget.
2022-01-07 17:13:16 +00:00
Sergio Martins
6cef4cea2c Port frameParent() to firstParentOfType() 2022-01-07 14:59:33 +00:00
Sergio Martins
aea2bf971b Add TestDocks::tst_mdi_mixed_with_docking
Tests that we can dock a MDI Layout.
Meaning the main window would support both docking and MDI.
This basic test passes. But there's still a lot of bugs to fix
2022-01-07 12:50:25 +00:00
Sergio Martins
c8b22e7ea5 Fix "Unpin" button not showing up in overlayed widgets 2021-11-18 12:15:23 +00:00
Sergio Martins
099c7eafc8 tests: Fix QtQuick tests
normal geometry isn't supported for QWindow, only QWidget.
2021-11-17 15:41:50 +00:00