homescreens/halcyon: Fix overshoot

This commit is contained in:
Devin Lin 2022-06-23 17:02:32 -04:00
parent 213faea679
commit 108daf50db
2 changed files with 8 additions and 6 deletions

View file

@ -35,7 +35,7 @@ GridView {
header: Controls.Control { header: Controls.Control {
implicitWidth: gridView.width implicitWidth: gridView.width
topPadding: PlasmaCore.Units.largeSpacing + Math.round(gridView.height * 0.2) topPadding: PlasmaCore.Units.largeSpacing + Math.round(gridView.height * 0.25)
bottomPadding: PlasmaCore.Units.largeSpacing bottomPadding: PlasmaCore.Units.largeSpacing
leftPadding: PlasmaCore.Units.smallSpacing leftPadding: PlasmaCore.Units.smallSpacing

View file

@ -73,13 +73,15 @@ Item {
onVerticalOvershootChanged: { onVerticalOvershootChanged: {
if (dragging && verticalOvershoot < 0) { if (dragging && verticalOvershoot < 0) {
if (!openingSearchWidget) { if (!openingSearchWidget) {
if (oldVerticalOvershoot === 0) {
openingSearchWidget = true; openingSearchWidget = true;
root.searchWidget.startGesture(); root.searchWidget.startGesture();
} }
} else {
let offset = -(verticalOvershoot - oldVerticalOvershoot); let offset = -(verticalOvershoot - oldVerticalOvershoot);
root.searchWidget.updateGestureOffset(-offset); root.searchWidget.updateGestureOffset(-offset);
} }
}
oldVerticalOvershoot = verticalOvershoot; oldVerticalOvershoot = verticalOvershoot;
} }
onDraggingChanged: { onDraggingChanged: {