diff --git a/components/HomeScreenControls.qml b/components/HomeScreenControls.qml index 56901dc7..8c650cd5 100644 --- a/components/HomeScreenControls.qml +++ b/components/HomeScreenControls.qml @@ -14,8 +14,7 @@ QtObject { signal resetHomeScreenPosition() signal snapHomeScreenPosition() - signal requestHomeScreenPosition(real y) - property real homeScreenPosition: 0 + signal requestRelativeScroll(point pos) property Item homeScreen property QtObject homeScreenWindow property bool homeScreenVisible: true diff --git a/containments/homescreen/package/contents/ui/launcher/AppDrawer.qml b/containments/homescreen/package/contents/ui/launcher/AppDrawer.qml index e1f7c982..bef592a2 100644 --- a/containments/homescreen/package/contents/ui/launcher/AppDrawer.qml +++ b/containments/homescreen/package/contents/ui/launcher/AppDrawer.qml @@ -198,7 +198,6 @@ Item { oldContentY = contentY; root.offset = contentY + view.originY + view.height*2 - root.closedPositionOffset*2 - MobileShell.HomeScreenControls.homeScreenPosition = contentY } onMovementEnded: root.snapDrawerStatus() onFlickEnded: movementEnded() diff --git a/containments/homescreen/package/contents/ui/main.qml b/containments/homescreen/package/contents/ui/main.qml index 30a6b761..e5e86d22 100644 --- a/containments/homescreen/package/contents/ui/main.qml +++ b/containments/homescreen/package/contents/ui/main.qml @@ -76,15 +76,15 @@ FocusScope { appDrawer.close(); } function onSnapHomeScreenPosition() { - if (lastRequestedPosition > 0) { + if (lastRequestedPosition < 0) { appDrawer.open(); } else { appDrawer.close(); } } - function onRequestHomeScreenPosition(y) { - appDrawer.offset += y; - lastRequestedPosition = y; + function onRequestRelativeScroll(pos) { + appDrawer.offset -= pos.y; + lastRequestedPosition = pos.y; } } diff --git a/containments/taskpanel/package/contents/ui/main.qml b/containments/taskpanel/package/contents/ui/main.qml index 96f084ce..e78dfb00 100644 --- a/containments/taskpanel/package/contents/ui/main.qml +++ b/containments/taskpanel/package/contents/ui/main.qml @@ -95,12 +95,15 @@ PlasmaCore.ColorScope { anchors.fill: parent property int oldMouseY: 0 property int startMouseY: 0 + property int oldMouseX: 0 + property int startMouseX: 0 property bool isDragging: false property bool opening: false drag.filterChildren: true property Button activeButton onPressed: { + startMouseX = oldMouseX = mouse.y; startMouseY = oldMouseY = mouse.y; taskSwitcher.offset = -taskSwitcher.height; activeButton = icons.childAt(mouse.x, mouse.y); @@ -125,9 +128,10 @@ PlasmaCore.ColorScope { taskSwitcher.showFullScreen(); //no tasks, let's scroll up the homescreen instead } else if (taskSwitcher.tasksCount === 0) { - MobileShell.HomeScreenControls.requestHomeScreenPosition(MobileShell.HomeScreenControls.homeScreenPosition - (mouse.y - oldMouseY)); + MobileShell.HomeScreenControls.requestRelativeScroll(Qt.point(mouse.x - oldMouseX, mouse.y - oldMouseY)); } oldMouseY = mouse.y; + oldMouseY = mouse.y; } onReleased: { if (taskSwitcher.visibility == Window.Hidden) { @@ -214,7 +218,6 @@ PlasmaCore.ColorScope { height: parent.height width: parent.width*0.8/3 mouseArea: mainMouseArea - enabled: !taskSwitcher.visible && (root.showingApp || MobileShell.HomeScreenControls.homeScreenPosition != 0) onClicked: { if (!enabled) { return;