on xenial help sign in
correct offsets + borderThickness
commitc8fd873bce0eb8761ab47dcf3a0f7dccb83bc06c authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 30 Mar 2016, 02:58 (11 years ago) parent5b1583f
2 files changed+34−8
qml/Stages/DesktopStage.qml+4−2 qml/Stages/WindowControlsOverlay.qml+30−6
qml/Stages/DesktopStage.qml+4−2
@@ -497,7 +497,7 @@ AbstractStage {
497497 target: appDelegate
498498 minWidth: units.gu(10)
499499 minHeight: units.gu(10)
500− borderThickness: units.gu(2)
500+ borderThickness: units.gu(1)
501501 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
502502 screenWidth: appContainer.width
503503 screenHeight: appContainer.height
@@ -545,7 +545,9 @@ AbstractStage {
545545 }
546546
547547 WindowControlsOverlay {
548− target: resizeArea
548+ anchors.fill: resizeArea
549+ target: appDelegate
550+ borderThickness: resizeArea.borderThickness
549551 }
550552
551553 WindowedFullscreenPolicy {
qml/Stages/WindowControlsOverlay.qml+30−6
@@ -20,11 +20,11 @@ import Ubuntu.Gestures 0.1
2020
2121Item {
2222 // to be set from outside
23− property Item target: null
24−
25− anchors.fill: target
23+ property Item target // appDelegate
24+ property int borderThickness
2625
2726 TabletSideStageTouchGesture {
27+ id: gestureArea
2828 minimumTouchPoints: 2
2929 maximumTouchPoints: 2
3030 anchors.fill: parent
@@ -35,17 +35,20 @@ Item {
3535 overlayTimer.running = true;
3636 }
3737 }
38+ onRecognisedDragChanged: {
39+ print("Drag recognized:", recognisedDrag)
40+ }
3841 onDragStarted: print("Drag started")
3942 onDropped: print("Dropped")
4043 onCancelled: print("Cancelled")
4144 }
4245
43− Timer {
46+ Timer { // dismiss timer
4447 id: overlayTimer
4548 interval: 2000
4649 }
4750
48− InverseMouseArea {
51+ InverseMouseArea { // dismiss area
4952 anchors.fill: overlay
5053 onClicked: overlayTimer.stop()
5154 }
@@ -53,7 +56,8 @@ Item {
5356 Item {
5457 id: overlay
5558 anchors.fill: parent
56− visible: overlayTimer.running
59+ visible: (overlayTimer.running && target && !target.maximized && !target.fullscreen) ||
60+ gestureArea.recognisedDrag
5761 enabled: visible
5862
5963 Image {
@@ -65,48 +69,68 @@ Item {
6569
6670 ResizeGrip { // top left
6771 anchors.horizontalCenter: parent.left
72+ anchors.horizontalCenterOffset: borderThickness
6873 anchors.verticalCenter: parent.top
74+ anchors.verticalCenterOffset: borderThickness
75+ visible: target && !target.maximizedLeft && !target.maximizedRight
6976 }
7077
7178 ResizeGrip { // top center
7279 anchors.horizontalCenter: parent.horizontalCenter
7380 anchors.verticalCenter: parent.top
81+ anchors.verticalCenterOffset: borderThickness
7482 rotation: 45
83+ visible: target && !target.maximizedLeft && !target.maximizedRight
7584 }
7685
7786 ResizeGrip { // top right
7887 anchors.horizontalCenter: parent.right
88+ anchors.horizontalCenterOffset: -borderThickness
7989 anchors.verticalCenter: parent.top
90+ anchors.verticalCenterOffset: borderThickness
8091 rotation: 90
92+ visible: target && !target.maximizedLeft && !target.maximizedRight
8193 }
8294
8395 ResizeGrip { // right
8496 anchors.horizontalCenter: parent.right
97+ anchors.horizontalCenterOffset: -borderThickness
8598 anchors.verticalCenter: parent.verticalCenter
8699 rotation: 135
100+ visible: target && !target.maximizedRight
87101 }
88102
89103 ResizeGrip { // bottom right
90104 anchors.horizontalCenter: parent.right
105+ anchors.horizontalCenterOffset: -borderThickness
91106 anchors.verticalCenter: parent.bottom
107+ anchors.verticalCenterOffset: -borderThickness
108+ visible: target && !target.maximizedLeft && !target.maximizedRight
92109 }
93110
94111 ResizeGrip { // bottom center
95112 anchors.horizontalCenter: parent.horizontalCenter
96113 anchors.verticalCenter: parent.bottom
114+ anchors.verticalCenterOffset: -borderThickness
97115 rotation: 45
116+ visible: target && !target.maximizedLeft && !target.maximizedRight
98117 }
99118
100119 ResizeGrip { // bottom left
101120 anchors.horizontalCenter: parent.left
121+ anchors.horizontalCenterOffset: borderThickness
102122 anchors.verticalCenter: parent.bottom
123+ anchors.verticalCenterOffset: -borderThickness
103124 rotation: 90
125+ visible: target && !target.maximizedLeft && !target.maximizedRight
104126 }
105127
106128 ResizeGrip { // left
107129 anchors.horizontalCenter: parent.left
130+ anchors.horizontalCenterOffset: borderThickness
108131 anchors.verticalCenter: parent.verticalCenter
109132 rotation: 135
133+ visible: target && !target.maximizedLeft
110134 }
111135 }
112136}