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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user