diff options
author | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-09-14 16:24:30 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-09-16 10:35:14 +0000 |
commit | dae5d55dea859bb3a5722bf665d077f1f9b3d360 (patch) | |
tree | d08e0906b015add456105a1bc261fdcfba2f8701 /examples/wayland/pure-qml/qml/main.qml | |
parent | e9aa3a9edf63ff0f47f38e73ef20403f7bec1a0d (diff) |
Implement resize/move for pure-qml
Change-Id: I7919f7715486fa2d8cfe35c08095f6c33757a515
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'examples/wayland/pure-qml/qml/main.qml')
-rw-r--r-- | examples/wayland/pure-qml/qml/main.qml | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml index 7f47e1325..d20ea10fd 100644 --- a/examples/wayland/pure-qml/qml/main.qml +++ b/examples/wayland/pure-qml/qml/main.qml @@ -60,49 +60,17 @@ WaylandCompositor { Component { id: surfaceComponent WaylandSurface { - property QtObject shellSurface: null } } extensions: [ - DefaultShell { + Shell { id: defaultShell - Component { - id: shellSurfaceComponent - DefaultShellSurface { - property Item chrome - property var previousMousePosition - property var originalInputEventsEnabled - Connections { - target: chrome ? chrome : null - onMouseMove: { - var deltaX = windowPosition.x - previousMousePosition.x - var deltaY = windowPosition.y - previousMousePosition.y - chrome.x = chrome.x + deltaX - chrome.y = chrome.y + deltaY - previousMousePosition = windowPosition; - } - onMouseRelease: { - chrome.inputEventsEnabled = originalInputEventsEnabled; - } - } - - onStartMove: { - previousMousePosition = chrome.mousePressPosition - originalInputEventsEnabled = chrome.inputEventsEnabled - chrome.inputEventsEnabled = false; - } - - } - } onCreateShellSurface: { var item = chromeComponent.createObject(defaultOutput.surfaceArea, { "surface": surface } ); - var shellSurface = shellSurfaceComponent.createObject( null, { "chrome": item }); - shellSurface.chrome = item; - shellSurface.initialize(defaultShell, surface, client, id); - surface.shellSurface = shellSurface; + item.shellSurface.initialize(defaultShell, surface, client, id); } Component.onCompleted: { @@ -112,12 +80,12 @@ WaylandCompositor { ] onCreateSurface: { - var surface = surfaceComponent.createObject(0, { } ); + var surface = surfaceComponent.createObject(compositor, { } ); surface.initialize(compositor, client, id, version); } Component.onCompleted: { - screenComponent.createObject(0, { "outputSpace" : defaultOutputSpace } ); + screenComponent.createObject(compositor, { "outputSpace" : defaultOutputSpace } ); } } |