diff --git a/containments/homescreen/package/contents/ui/AppletsArea.qml b/containments/homescreen/package/contents/ui/AppletsArea.qml index 90e72f57..0edaa60d 100644 --- a/containments/homescreen/package/contents/ui/AppletsArea.qml +++ b/containments/homescreen/package/contents/ui/AppletsArea.qml @@ -36,6 +36,8 @@ MouseEventListener { property Item draggingApplet property int startMouseX property int startMouseY + property int oldMouseX + property int oldMouseY SequentialAnimation { id: removeAnim @@ -56,6 +58,8 @@ MouseEventListener { onPressed: { startMouseX = mouse.screenX; startMouseY = mouse.screenY; + oldMouseX = mouse.screenX; + oldMouseY = mouse.screenY; } onPressAndHold: { print(favoritesView.contains(mapToItem(favoritesView, mouse.x, mouse.y))) @@ -82,13 +86,16 @@ MouseEventListener { return; } + applicationsView.interactive = false; if (Math.abs(mouse.screenX - startMouseX) > units.gridUnit || Math.abs(mouse.screenY - startMouseY) > units.gridUnit) { editOverlay.opacity = 0; } - draggingApplet.y = mouse.y - draggingApplet.height/2; - draggingApplet.x = mouse.x - draggingApplet.width/2; + draggingApplet.x -= oldMouseX - mouse.screenX; + draggingApplet.y -= oldMouseY - mouse.screenY; + oldMouseX = mouse.screenX; + oldMouseY = mouse.screenY; var pos = mapToItem(appletsLayout, mouse.x, mouse.y); var itemUnderMouse = appletsSpace.layout.childAt(pos.x, pos.y); @@ -119,10 +126,9 @@ MouseEventListener { return; } - if (draggingApplet.x > -draggingApplet.width/4 && draggingApplet.x < draggingApplet.width/4) { + if (draggingApplet.x > -draggingApplet.width/3 && draggingApplet.x < draggingApplet.width/3) { draggingApplet.x = 0; root.layoutManager.insertBefore( dndSpacer, draggingApplet); - draggingApplet.animationsEnabled = true; } else { removeAnim.target = draggingApplet; removeAnim.to = (draggingApplet.x > 0) ? root.width : -root.width @@ -184,13 +190,6 @@ MouseEventListener { easing.type: Easing.InOutQuad } } - add: Transition { - NumberAnimation { - properties: "x,y" - duration: units.longDuration - easing.type: Easing.InOutQuad - } - } } Item { id: dndSpacer diff --git a/containments/homescreen/package/contents/ui/EditOverlay.qml b/containments/homescreen/package/contents/ui/EditOverlay.qml index 4eccbcd8..fae42479 100644 --- a/containments/homescreen/package/contents/ui/EditOverlay.qml +++ b/containments/homescreen/package/contents/ui/EditOverlay.qml @@ -81,7 +81,7 @@ Rectangle { top: parent.top topMargin: parent.margins.top } - PlasmaComponents.Button { + PlasmaComponents.ToolButton { Layout.fillWidth: true Layout.fillHeight:true text: i18n("Wallpaper...") @@ -90,7 +90,7 @@ Rectangle { editOverlay.opacity = 0; } } - PlasmaComponents.Button { + PlasmaComponents.ToolButton { Layout.fillWidth: true Layout.fillHeight:true text: i18n("Add Widgets...") diff --git a/containments/homescreen/package/contents/ui/main.qml b/containments/homescreen/package/contents/ui/main.qml index 98f765de..1e3e39ac 100644 --- a/containments/homescreen/package/contents/ui/main.qml +++ b/containments/homescreen/package/contents/ui/main.qml @@ -170,7 +170,7 @@ Item { property bool animationsEnabled: true property Item applet z: applet && applet.compactRepresentationItem && applet.expanded ? 99 : 0 - opacity: 1/Math.abs(x/(width/2)) + opacity: 1 - Math.abs(x/(width/2)) Layout.fillWidth: true Layout.fillHeight: applet && applet.Layout.fillHeight @@ -257,6 +257,7 @@ Item { z: 999 } MouseEventListener { + id: mainListener anchors.fill: parent //Events handling: those events are about clicking and reordering of app icons