on xenial help sign in
make folding after dragging sequential to expanding to avoid weird jumpiness
commit4e1109b4c6900027730ef6e4cb11d486d48d4d7d authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 16 Aug 2013, 17:24 (13 years ago) parent3db6f6a
1 file changed+11−5
Launcher/LauncherPanel.qml+11−5
Launcher/LauncherPanel.qml+11−5
@@ -163,7 +163,7 @@ Item {
163163 },
164164 State {
165165 name: "expanded"
166− when: dndArea.draggedIndex >= 0 && (dndArea.preDragging || dndArea.selectedItem.dragging) && !dragging
166+ when: dndArea.draggedIndex >= 0 && (dndArea.preDragging || dndArea.dragging || dndArea.postDragging) && dndArea.draggedIndex != index
167167 PropertyChanges {
168168 target: launcherDelegate
169169 angle: 0
@@ -201,7 +201,11 @@ Item {
201201 from: "dragging"
202202 to: "*"
203203 NumberAnimation { properties: "itemOpacity"; duration: UbuntuAnimation.BriskDuration }
204− NumberAnimation { properties: "height"; duration: UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing }
204+ SequentialAnimation {
205+ NumberAnimation { properties: "height"; duration:UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing }
206+ PropertyAction { target: dndArea; property: "postDragging"; value: false }
207+ PropertyAction { target: dndArea; property: "draggedIndex"; value: -1 }
208+ }
205209 }
206210 ]
207211 }
@@ -215,6 +219,8 @@ Item {
215219 property int draggedIndex: -1
216220 property var selectedItem
217221 property bool preDragging: false
222+ property bool dragging: selectedItem !== undefined && selectedItem.dragging
223+ property bool postDragging: false
218224 property int startX
219225 property int startY
220226
@@ -256,10 +262,11 @@ Item {
256262 selectedItem.highlighted = false
257263 selectedItem = undefined;
258264 preDragging = false;
265+ postDragging = false;
259266 }
260267
261268 onReleased: {
262− draggedIndex = -1;
269+ postDragging = true;
263270 selectedItem.highlighted = false
264271 selectedItem.dragging = false;
265272 selectedItem = undefined;
@@ -292,7 +299,6 @@ Item {
292299
293300 onPositionChanged: {
294301 if (draggedIndex >= 0) {
295−
296302 if (!selectedItem.dragging) {
297303 var distance = Math.max(Math.abs(mouseX - startX), Math.abs(mouseY - startY))
298304 if (!preDragging && distance > units.gu(1.5)) {
@@ -393,7 +399,7 @@ Item {
393399 LauncherDelegate {
394400 id: fakeDragItem
395401 objectName: "fakeDragItem"
396− visible: dndArea.draggedIndex >= 0
402+ visible: dndArea.draggedIndex >= 0 && !dndArea.postDragging
397403 itemWidth: launcherListView.itemWidth
398404 itemHeight: launcherListView.itemHeight
399405 height: itemHeight