on xenial help sign in
correct offsets + borderThickness
c8fd873Lukáš Tinkl
qml/Stages/DesktopStage.qml+4−2
@@ -497,7 +497,7 @@ AbstractStage {
497 target: appDelegate
497 target: appDelegate
498 minWidth: units.gu(10)
498 minWidth: units.gu(10)
499 minHeight: units.gu(10)
499 minHeight: units.gu(10)
500− borderThickness: units.gu(2)
500+ borderThickness: units.gu(1)
501 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
501 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
502 screenWidth: appContainer.width
502 screenWidth: appContainer.width
503 screenHeight: appContainer.height
503 screenHeight: appContainer.height
@@ -545,7 +545,9 @@ AbstractStage {
545 }
545 }
546
546
547 WindowControlsOverlay {
547 WindowControlsOverlay {
548− target: resizeArea
548+ anchors.fill: resizeArea
549+ target: appDelegate
550+ borderThickness: resizeArea.borderThickness
549 }
551 }
550
552
551 WindowedFullscreenPolicy {
553 WindowedFullscreenPolicy {
qml/Stages/WindowControlsOverlay.qml+30−6
@@ -20,11 +20,11 @@ import Ubuntu.Gestures 0.1
20
20
21Item {
21Item {
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
25− anchors.fill: target
26
25
27 TabletSideStageTouchGesture {
26 TabletSideStageTouchGesture {
27+ id: gestureArea
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;
36 }
36 }
37 }
37 }
38+ onRecognisedDragChanged: {
39+ print("Drag recognized:", recognisedDrag)
40+ }
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")
41 }
44 }
42
45
43− Timer {
46+ Timer { // dismiss timer
44 id: overlayTimer
47 id: overlayTimer
45 interval: 2000
48 interval: 2000
46 }
49 }
47
50
48− InverseMouseArea {
51+ InverseMouseArea { // dismiss area
49 anchors.fill: overlay
52 anchors.fill: overlay
50 onClicked: overlayTimer.stop()
53 onClicked: overlayTimer.stop()
51 }
54 }
@@ -53,7 +56,8 @@ Item {
53 Item {
56 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
58
62
59 Image {
63 Image {
@@ -65,48 +69,68 @@ Item {
65
69
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
69 }
76 }
70
77
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
75 }
84 }
76
85
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
81 }
93 }
82
94
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
87 }
101 }
88
102
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
92 }
109 }
93
110
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
98 }
117 }
99
118
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
104 }
126 }
105
127
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
110 }
134 }
111 }
135 }
112}
136}