on xenial help sign in
some tweaks and cleanups
commit07f86b206eb230ea9f4f72a0d6c3d58e63eb556d authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 21 Mar 2017, 15:05 (10 years ago) parent7dd8766
3 files changed+18−27
qml/Stage/ApplicationWindow.qml−6 qml/Stage/Spread/SpreadDelegateInputArea.qml+17−20 qml/Stage/Stage.qml+1−1
qml/Stage/ApplicationWindow.qml−6
@@ -121,12 +121,6 @@ FocusScope {
121121 }
122122 }
123123
124− Timer {
125− id: surfaceIsOldTimer
126− interval: 1000
127− onTriggered: { if (stateGroup.state === "surface") { d.surfaceOldEnoughToBeResized = true; } }
128− }
129−
130124 Loader {
131125 id: splashLoader
132126 visible: active
qml/Stage/Spread/SpreadDelegateInputArea.qml+17−20
@@ -84,36 +84,27 @@ Item {
8484 }
8585 }
8686
87− // Event eater
88−// MouseArea {
89−// anchors.fill: parent
90−// onClicked: root.clicked()
91−// onWheel: wheel.accepted = true
92−// }
93−
9487 MultiPointTouchArea {
9588 anchors.fill: parent
96−// mouseEnabled: false
9789 maximumTouchPoints: 1
9890 property int offset: 0
9991
92+ // tp.startY seems to be broken for mouse interaction... lets track it ourselves
93+ property int startY: 0
94+
10095 touchPoints: [
10196 TouchPoint {
10297 id: tp
10398 }
10499 ]
105100
106− onCanceled: {
107− print("****************** cancelled")
108− fakeDragItem.Drag.active = false;
109− fakeDragItem.surface = null;
110− d.moving = false
111− animation.animate("center");
101+ onPressed: {
102+ startY = tp.y
112103 }
113104
114105 onTouchUpdated: {
115106 if (!d.moving || !tp.pressed) {
116− if (Math.abs(tp.startY - tp.y) > d.threshold) {
107+ if (Math.abs(startY - tp.y) > d.threshold) {
117108 d.moving = true;
118109 d.dragEvents = []
119110 offset = tp.y - tp.startY;
@@ -126,10 +117,10 @@ Item {
126117 var value = tp.y - tp.startY - offset;
127118 if (value < 0) {
128119 var coords = mapToItem(shell, tp.x, tp.y);
129− fakeDragItem.x = coords.x - units.gu(5)
130− fakeDragItem.y = coords.y - units.gu(5)
131− fakeDragItem.Drag.hotSpot.x = units.gu(5)
132− fakeDragItem.Drag.hotSpot.y = units.gu(5)
120+ fakeDragItem.Drag.hotSpot.x = fakeDragItem.width / 2
121+ fakeDragItem.Drag.hotSpot.y = units.gu(2)
122+ fakeDragItem.x = coords.x - fakeDragItem.Drag.hotSpot.x
123+ fakeDragItem.y = coords.y - fakeDragItem.Drag.hotSpot.y
133124 fakeDragItem.Drag.active = true;
134125 fakeDragItem.surface = model.window.surface;
135126
@@ -145,7 +136,6 @@ Item {
145136 }
146137
147138 onReleased: {
148− print("released!")
149139 var result = fakeDragItem.Drag.drop();
150140 fakeDragItem.surface = null;
151141
@@ -168,6 +158,13 @@ Item {
168158 animation.animate("center")
169159 }
170160 }
161+
162+ onCanceled: {
163+ fakeDragItem.Drag.active = false;
164+ fakeDragItem.surface = null;
165+ d.moving = false
166+ animation.animate("center");
167+ }
171168 }
172169
173170 UbuntuNumberAnimation {
qml/Stage/Stage.qml+1−1
@@ -571,7 +571,7 @@ FocusScope {
571571 ScreensAndWorkspaces {
572572 id: screensAndWorkspaces
573573 anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: root.leftMargin }
574− height: Math.max(units.gu(35), parent.height * .4)
574+ height: Math.max(units.gu(30), parent.height * .3)
575575 background: root.background
576576 opacity: 0
577577 visible: opacity > 0