diff options
Diffstat (limited to 'examples/wayland/server-side-decoration')
-rw-r--r-- | examples/wayland/server-side-decoration/main.qml | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/examples/wayland/server-side-decoration/main.qml b/examples/wayland/server-side-decoration/main.qml index 8ec50dd57..5847ce411 100644 --- a/examples/wayland/server-side-decoration/main.qml +++ b/examples/wayland/server-side-decoration/main.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.6 +import QtQuick 2.12 import QtQuick.Window 2.2 import QtQuick.Layouts 1.3 import QtWayland.Compositor 1.3 @@ -61,29 +61,40 @@ WaylandCompositor { width: 1024 height: 768 visible: true + Rectangle { + anchors.fill: parent + gradient: "MorpheusDen" + } + Repeater { model: shellSurfaces Column { + id: chrome + width: shellSurfaceItem.implicitWidth Rectangle { visible: modelData.toplevel.decorationMode === XdgToplevel.ServerSideDecoration width: parent.width height: 30 gradient: "HeavyRain"; - RowLayout { - anchors.fill: parent - Text { - text: modelData.toplevel.title - Layout.fillWidth: true - } - MouseArea { - width: 30 - height: 30 - Text { text: "X"; anchors.centerIn: parent } - onClicked: modelData.toplevel.sendClose() + Text { + text: modelData.toplevel.title + anchors.centerIn: parent + } + Item { + anchors.right: parent.right + width: 30 + height: 30 + Text { text: "X"; anchors.centerIn: parent } + TapHandler { + onTapped: modelData.toplevel.sendClose() } } + DragHandler { + target: chrome + } } ShellSurfaceItem { + id: shellSurfaceItem moveItem: parent autoCreatePopupItems: true shellSurface: modelData |