fix controlling from the bottom panel

This commit is contained in:
Marco Martin 2021-04-13 14:03:05 +02:00
parent b98c7ec224
commit 8483bcbe0f
4 changed files with 10 additions and 9 deletions

View file

@ -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

View file

@ -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()

View file

@ -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;
}
}

View file

@ -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;