on xenial help sign in
some tweaks and cleanups
07f86b2Michael Zanetti
qml/Stage/ApplicationWindow.qml−6
@@ -121,12 +121,6 @@ FocusScope {
121 }
121 }
122 }
122 }
123
123
124− Timer {
125− id: surfaceIsOldTimer
126− interval: 1000
127− onTriggered: { if (stateGroup.state === "surface") { d.surfaceOldEnoughToBeResized = true; } }
128− }
129−
130 Loader {
124 Loader {
131 id: splashLoader
125 id: splashLoader
132 visible: active
126 visible: active
qml/Stage/Spread/SpreadDelegateInputArea.qml+17−20
@@ -84,36 +84,27 @@ Item {
84 }
84 }
85 }
85 }
86
86
87− // Event eater
88−// MouseArea {
89−// anchors.fill: parent
90−// onClicked: root.clicked()
91−// onWheel: wheel.accepted = true
92−// }
93−
94 MultiPointTouchArea {
87 MultiPointTouchArea {
95 anchors.fill: parent
88 anchors.fill: parent
96−// mouseEnabled: false
97 maximumTouchPoints: 1
89 maximumTouchPoints: 1
98 property int offset: 0
90 property int offset: 0
99
91
92+ // tp.startY seems to be broken for mouse interaction... lets track it ourselves
93+ property int startY: 0
94+
100 touchPoints: [
95 touchPoints: [
101 TouchPoint {
96 TouchPoint {
102 id: tp
97 id: tp
103 }
98 }
104 ]
99 ]
105
100
106− onCanceled: {
101+ onPressed: {
107− print("****************** cancelled")
102+ startY = tp.y
108− fakeDragItem.Drag.active = false;
109− fakeDragItem.surface = null;
110− d.moving = false
111− animation.animate("center");
112 }
103 }
113
104
114 onTouchUpdated: {
105 onTouchUpdated: {
115 if (!d.moving || !tp.pressed) {
106 if (!d.moving || !tp.pressed) {
116− if (Math.abs(tp.startY - tp.y) > d.threshold) {
107+ if (Math.abs(startY - tp.y) > d.threshold) {
117 d.moving = true;
108 d.moving = true;
118 d.dragEvents = []
109 d.dragEvents = []
119 offset = tp.y - tp.startY;
110 offset = tp.y - tp.startY;
@@ -126,10 +117,10 @@ Item {
126 var value = tp.y - tp.startY - offset;
117 var value = tp.y - tp.startY - offset;
127 if (value < 0) {
118 if (value < 0) {
128 var coords = mapToItem(shell, tp.x, tp.y);
119 var coords = mapToItem(shell, tp.x, tp.y);
129− fakeDragItem.x = coords.x - units.gu(5)
120+ fakeDragItem.Drag.hotSpot.x = fakeDragItem.width / 2
130− fakeDragItem.y = coords.y - units.gu(5)
121+ fakeDragItem.Drag.hotSpot.y = units.gu(2)
131− fakeDragItem.Drag.hotSpot.x = units.gu(5)
122+ fakeDragItem.x = coords.x - fakeDragItem.Drag.hotSpot.x
132− fakeDragItem.Drag.hotSpot.y = units.gu(5)
123+ fakeDragItem.y = coords.y - fakeDragItem.Drag.hotSpot.y
133 fakeDragItem.Drag.active = true;
124 fakeDragItem.Drag.active = true;
134 fakeDragItem.surface = model.window.surface;
125 fakeDragItem.surface = model.window.surface;
135
126
@@ -145,7 +136,6 @@ Item {
145 }
136 }
146
137
147 onReleased: {
138 onReleased: {
148− print("released!")
149 var result = fakeDragItem.Drag.drop();
139 var result = fakeDragItem.Drag.drop();
150 fakeDragItem.surface = null;
140 fakeDragItem.surface = null;
151
141
@@ -168,6 +158,13 @@ Item {
168 animation.animate("center")
158 animation.animate("center")
169 }
159 }
170 }
160 }
161+
162+ onCanceled: {
163+ fakeDragItem.Drag.active = false;
164+ fakeDragItem.surface = null;
165+ d.moving = false
166+ animation.animate("center");
167+ }
171 }
168 }
172
169
173 UbuntuNumberAnimation {
170 UbuntuNumberAnimation {
qml/Stage/Stage.qml+1−1
@@ -571,7 +571,7 @@ FocusScope {
571 ScreensAndWorkspaces {
571 ScreensAndWorkspaces {
572 id: screensAndWorkspaces
572 id: screensAndWorkspaces
573 anchors { left: parent.left; top: parent.top; right: parent.right; leftMargin: root.leftMargin }
573 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)
575 background: root.background
575 background: root.background
576 opacity: 0
576 opacity: 0
577 visible: opacity > 0
577 visible: opacity > 0