@@ -20,11 +20,11 @@ import Ubuntu.Gestures 0.1
22 // to be set from outside
22 // to be set from outside
23− property Item target: null
23+ property Item target // appDelegate
24−
24+ property int borderThickness
27 TabletSideStageTouchGesture {
26 TabletSideStageTouchGesture {
28 minimumTouchPoints: 2
28 minimumTouchPoints: 2
29 maximumTouchPoints: 2
29 maximumTouchPoints: 2
30 anchors.fill: parent
30 anchors.fill: parent
@@ -35,17 +35,20 @@ Item {
35 overlayTimer.running = true;
35 overlayTimer.running = true;
38+ onRecognisedDragChanged: {
39+ print("Drag recognized:", recognisedDrag)
38 onDragStarted: print("Drag started")
41 onDragStarted: print("Drag started")
39 onDropped: print("Dropped")
42 onDropped: print("Dropped")
40 onCancelled: print("Cancelled")
43 onCancelled: print("Cancelled")
43− Timer {
46+ Timer { // dismiss timer
44 id: overlayTimer
47 id: overlayTimer
45 interval: 2000
48 interval: 2000
48− InverseMouseArea {
51+ InverseMouseArea { // dismiss area
49 anchors.fill: overlay
52 anchors.fill: overlay
50 onClicked: overlayTimer.stop()
53 onClicked: overlayTimer.stop()
@@ -53,7 +56,8 @@ Item {
54 id: overlay
57 id: overlay
55 anchors.fill: parent
58 anchors.fill: parent
56− visible: overlayTimer.running
59+ visible: (overlayTimer.running && target && !target.maximized && !target.fullscreen) ||
60+ gestureArea.recognisedDrag
57 enabled: visible
61 enabled: visible
@@ -65,48 +69,68 @@ Item {
66 ResizeGrip { // top left
70 ResizeGrip { // top left
67 anchors.horizontalCenter: parent.left
71 anchors.horizontalCenter: parent.left
72+ anchors.horizontalCenterOffset: borderThickness
68 anchors.verticalCenter: parent.top
73 anchors.verticalCenter: parent.top
74+ anchors.verticalCenterOffset: borderThickness
75+ visible: target && !target.maximizedLeft && !target.maximizedRight
71 ResizeGrip { // top center
78 ResizeGrip { // top center
72 anchors.horizontalCenter: parent.horizontalCenter
79 anchors.horizontalCenter: parent.horizontalCenter
73 anchors.verticalCenter: parent.top
80 anchors.verticalCenter: parent.top
81+ anchors.verticalCenterOffset: borderThickness
74 rotation: 45
82 rotation: 45
83+ visible: target && !target.maximizedLeft && !target.maximizedRight
77 ResizeGrip { // top right
86 ResizeGrip { // top right
78 anchors.horizontalCenter: parent.right
87 anchors.horizontalCenter: parent.right
88+ anchors.horizontalCenterOffset: -borderThickness
79 anchors.verticalCenter: parent.top
89 anchors.verticalCenter: parent.top
90+ anchors.verticalCenterOffset: borderThickness
80 rotation: 90
91 rotation: 90
92+ visible: target && !target.maximizedLeft && !target.maximizedRight
83 ResizeGrip { // right
95 ResizeGrip { // right
84 anchors.horizontalCenter: parent.right
96 anchors.horizontalCenter: parent.right
97+ anchors.horizontalCenterOffset: -borderThickness
85 anchors.verticalCenter: parent.verticalCenter
98 anchors.verticalCenter: parent.verticalCenter
86 rotation: 135
99 rotation: 135
100+ visible: target && !target.maximizedRight
89 ResizeGrip { // bottom right
103 ResizeGrip { // bottom right
90 anchors.horizontalCenter: parent.right
104 anchors.horizontalCenter: parent.right
105+ anchors.horizontalCenterOffset: -borderThickness
91 anchors.verticalCenter: parent.bottom
106 anchors.verticalCenter: parent.bottom
107+ anchors.verticalCenterOffset: -borderThickness
108+ visible: target && !target.maximizedLeft && !target.maximizedRight
94 ResizeGrip { // bottom center
111 ResizeGrip { // bottom center
95 anchors.horizontalCenter: parent.horizontalCenter
112 anchors.horizontalCenter: parent.horizontalCenter
96 anchors.verticalCenter: parent.bottom
113 anchors.verticalCenter: parent.bottom
114+ anchors.verticalCenterOffset: -borderThickness
97 rotation: 45
115 rotation: 45
116+ visible: target && !target.maximizedLeft && !target.maximizedRight
100 ResizeGrip { // bottom left
119 ResizeGrip { // bottom left
101 anchors.horizontalCenter: parent.left
120 anchors.horizontalCenter: parent.left
121+ anchors.horizontalCenterOffset: borderThickness
102 anchors.verticalCenter: parent.bottom
122 anchors.verticalCenter: parent.bottom
123+ anchors.verticalCenterOffset: -borderThickness
103 rotation: 90
124 rotation: 90
125+ visible: target && !target.maximizedLeft && !target.maximizedRight
106 ResizeGrip { // left
128 ResizeGrip { // left
107 anchors.horizontalCenter: parent.left
129 anchors.horizontalCenter: parent.left
130+ anchors.horizontalCenterOffset: borderThickness
108 anchors.verticalCenter: parent.verticalCenter
131 anchors.verticalCenter: parent.verticalCenter
109 rotation: 135
132 rotation: 135
133+ visible: target && !target.maximizedLeft