qml: Layout the drop area and title bar inside the FloatingWindow

We could just control geometry of the c++ title bar and geometry,
but then the user wouldn't be able to style it, and users rather
style things in QML than subclassing FloatingWindow and writing C++.

So instance some .qml files to represent the drop area and floating
window, so user can muck with.

Hierarchy looks like this now:

-QQuickWindow
--FloatingWindowQuick (C++ QQuickItem)
---FloatingWindow.qml
----TitleBar.qml (reads state from TitleBar c++)
----DropArea.qml
-----DropArea (C++ QQuickItem)
------Frame
      etc
This commit is contained in:
Sergio Martins
2020-07-29 23:28:05 +01:00
parent c13f9c00aa
commit f8f596ad30
9 changed files with 106 additions and 25 deletions

View File

@@ -14,13 +14,15 @@ import QtQuick 2.9
Rectangle {
id: root
property QtObject frameCpp
readonly property QtObject titleBarCpp: frameCpp ? frameCpp.titleBar : null
color: "cyan"
anchors.fill: parent
TitleBar {
height: 30
titleBarCpp: frameCpp ? frameCpp.titleBar : null
titleBarCpp: root.titleBarCpp
visible: true
anchors {
top: parent.top
left: parent.left