Sergio Martins
36931e7c45
Allow DragController views to have access to its controller
...
For consistency
2022-07-20 13:12:52 +01:00
Sergio Martins
cd41697ee6
Added Config::startDragDistance()
...
Allows the user to change the drag threshold without having
to inherit from Platform
2022-07-07 11:11:02 +01:00
Sergio Martins
7d21516f6d
Add a m_thisWeakPtr member to Views
...
Allows to promote back to shared pointer
2022-07-02 20:12:33 +01:00
Sergio Martins
5639b5632a
tests: Construct QCoreApplication earlier
...
The global event filter wasn't being set as it didn't have
a qGuiApp at that point
2022-07-02 12:48:16 +01:00
Waqar Ahmed
7fc7fba697
Fix static build
2022-06-30 13:16:20 +05:00
Sergio Martins
aff9806ab1
Port away from using event filter in DockWidget.cpp
...
Platform now abstract the emittion of window activation/deactivation
2022-06-28 18:36:10 +01:00
Sergio Martins
83a2620015
Remove View_qtwidgets::asQWidget
2022-06-27 23:54:18 +01:00
Sergio Martins
3dd455bfb7
Port some code away from View::asQObject()
...
Use View_qt::asObject() instead
2022-06-27 23:37:27 +01:00
Sergio Martins
10c918b93c
Use View instead of ViewWrapper in the api
...
The latter will be an implementation detail soon
2022-06-24 00:10:50 +01:00
Sergio Martins
ff92af1e62
Removed some TODOs
...
The comment is still there in case it's interesting for someone,
but it's not something that will be worked on
2022-06-18 22:24:21 +01:00
Sergio Martins
4c4dcf4423
Move KDBindings usage from Platform.h to Platform_p.h.
...
So user doesn't need to install it
2022-06-18 12:28:54 +01:00
Sergio Martins
755bc6ac14
cmake: Don't add src/ to include path
...
Fully qualify includes instead
2022-06-14 16:57:22 +01:00
Sergio Martins
1acbf48786
Don't depend directly on QSizePolicy, as that's QtWidgets
...
Introduce our own enum. Soon our qtquick frontend won't link
against QtWidgets
2022-06-11 18:22:38 +01:00
Sergio Martins
060fe44e71
Remove some unneeded QApplication includes
2022-06-07 17:14:05 +01:00
Sergio Martins
5faf36700b
Use qGuiApp instead of qApp
...
As QtQuick applications might not have QApplication.
2022-06-06 13:24:38 +01:00
Sergio Martins
b201737149
Abstract mouse grabbing
...
It's done via the platforms, not via ifdefs anymore
2022-05-31 11:06:25 +01:00
Sergio Martins
31d43b6608
qtquick: Port inDisallowedDragView()
2022-05-30 19:45:58 +01:00
Sergio Martins
30ca6769e4
qtquick: Use the fallback mouse grabber
...
This code was needing porting.
2022-05-30 19:31:30 +01:00
Sergio Martins
6d760cb5e1
Rename Some _p.h headers to .h
...
Easier for vscode to toggle between header the source
2022-05-29 20:24:11 +01:00
Sergio Martins
bcaf0737e9
Move Platform::createMainWindow() to dev mode
...
This is for tests only
2022-05-27 12:11:43 +01:00
Sergio Martins
ad7f5f5970
tests: Remove some manual creation of QQuickView
...
It's abstracted by the platform now
2022-05-27 12:11:43 +01:00
Sergio Martins
03f1a6930c
Added Platform::createMainWindow()
...
Called by tests and layout linter to create a main window.
Simplifies creation of the main window, we can now remove one of the ctors.
Before we supported both the controller creating the view and vice-versa,
while this is convenient it's complex to support, due to order or initializations.
Now, you a create a view, and it creates the controller behind the scenes.
MainWindow is special in this sense, as it's created by the end user, it's
not something internal we want in the ViewFactory.
2022-05-27 10:36:54 +01:00
Sergio Martins
ebb623f080
Initialize static resources in the correct platform
...
Non-Qt platforms won't have to do this
2022-05-26 23:16:02 +01:00
Sergio Martins
bb4f5a5037
Mass renaming of last usages of FrameworkWidgetFactory
2022-05-19 08:12:29 +01:00
Sergio Martins
09eb303bab
Rename some methods from FrameworkWidget to View
2022-05-19 08:00:20 +01:00
Sergio Martins
4708b2c25d
Rename FrameworkWidgetFactory_qtwidgets|qtquick to ViewFactory_*
2022-05-19 07:51:50 +01:00
Sergio Martins
e514a8c3e1
Rename FrameworkWidgetFactory to ViewFactory
...
We now deal in views instead of widgets, and the "Framework"
part was redundant. It's also shorter now
2022-05-18 23:12:43 +01:00
Sergio Martins
aefbbd5738
Allow the classic/segmented views be created by FrameworkWidgetFactory
...
Instead of the controllers. We only allow the user to customize
the views.
2022-05-18 23:10:27 +01:00
Sergio Martins
2b6c18dbcd
Move the drop indicators into Controllers namespace
2022-05-18 04:24:16 +01:00
Sergio Martins
7b486bb28c
qtwidgets: Add views for the Classical and Segmented indicators
...
Copied from indicators/
2022-05-18 04:10:01 +01:00
Sergio Martins
1b35810766
Add Platform::createView()
...
For when kddw internalls need to create an empty view.
Use case will be to create the parent widget for the drop indicators.
2022-05-17 23:43:41 +01:00
Sergio Martins
7fbd1ea920
Added Platform::startDragDistance()
...
As its value is per platform.
2022-05-15 22:31:40 +01:00
Sergio Martins
b6d87d10c4
Add a TestHelpers_ file for each platform
...
So we don't have too much ifdefed stuff that's only for tests in
the main files.
2022-04-30 10:31:31 +01:00
Sergio Martins
c55cac97d0
tests: Add unit-test for View::setParent()
2022-04-29 18:46:28 +01:00
Sergio Martins
8d09acdf5f
tests: Fix warning about requiring to call init after qApp
2022-04-29 18:05:24 +01:00
Sergio Martins
9dc53f9755
tests: Create the QApplication in Platform ctor
...
Other frontends won't use QApplication, and QtQuick might even use
just QGuiApplication eventually
2022-04-29 15:36:16 +01:00
Sergio Martins
aa72a8cd5a
Add Platform_qtwidgets::init(), so we can share some code with ctors
2022-04-29 15:09:43 +01:00
Sergio Martins
099a9018df
Make it easier for tests to init the platform
...
Only a single static method is needed now, instead of 2.
2022-04-29 14:34:32 +01:00
Sergio Martins
34b07ef340
Delete the Platform when a test is complete
...
So that we support testing multiple platforms in the same test run
2022-04-29 14:05:35 +01:00
Sergio Martins
8015e49bee
Add Platform::screenSizeFor(window), removes more asQWidget() usage
2022-04-21 22:10:59 +01:00
Sergio Martins
4946cdeed3
Add Platform::screenNumberFor, removes more asQWidget() usage
2022-04-21 21:47:55 +01:00
Sergio Martins
05deea3cd8
tests: Move some ifdefed code to their respective platforms
2022-04-19 17:44:36 +01:00
Sergio Martins
8e4e998e74
tests: port away from QApplication::topLevelAt()
2022-04-14 23:44:39 +01:00
Sergio Martins
432ff65cc2
Remove QTimer hacks from Platform
...
It's now instantiated after qApp, so it's safe
2022-04-11 01:48:48 +01:00
Sergio Martins
037140b980
Add KDDockWidgets::initPlatform()
...
Instead of using the static variable, which is initialized before
having QApplication.
Will allow us to remove the QTimer from Platform init
2022-04-11 00:55:28 +01:00
Sergio Martins
8cd05c7314
Add Platform::createDefaultFrameworkWidgetFactory()
2022-04-10 23:54:52 +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
95671f9d9a
Add Platform_qt, a baseclass for both Qt frontends
...
So we can share some code between QtQuick and QtWidgets
2022-04-07 23:48:40 +01:00
Sergio Martins
4944ad5882
Add Platform::qobjectAsView()
...
to be removed once we port away from Qt, but needed for now to
support QtQuick
2022-04-07 23:10:01 +01:00
Sergio Martins
793e48150a
Don't access qApp directly from Platform's ctor
...
QApplication might not be created yet, so delay it
With a timer for now. Don't guarantee this will stay.
Explicit init by the user might be an alternative.
2022-04-05 22:29:01 +01:00