mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 14:43:09 +00:00
Tweak app drawer behavior
- Only trigger the app drawer open/close animation if the flick goes over an eighth of the screen so that small flicks do not trigger it - Adjust easing curve to be OutQuad so that fast flicks don't feel slow (have to slow to a stop, and then animation triggers) - Increase animation duration to account for OutQuad curve - Animate opacity of application icons as the app drawer comes in and out
This commit is contained in:
parent
40f6abd78e
commit
7a740a2f5d
1 changed files with 23 additions and 4 deletions
|
|
@ -98,9 +98,17 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view.movementDirection === AppDrawer.MovementDirection.Up) {
|
if (view.movementDirection === AppDrawer.MovementDirection.Up) {
|
||||||
open();
|
if (view.contentY > 7 * -view.height / 8) { // over one eighth of the screen
|
||||||
|
open();
|
||||||
|
} else {
|
||||||
|
close();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
close();
|
if (view.contentY < -view.height / 8) { // over one eighth of the screen
|
||||||
|
close();
|
||||||
|
} else {
|
||||||
|
open();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,8 +124,9 @@ Item {
|
||||||
id: scrollAnim
|
id: scrollAnim
|
||||||
target: view
|
target: view
|
||||||
properties: "contentY"
|
properties: "contentY"
|
||||||
duration: units.longDuration
|
duration: units.longDuration * 2
|
||||||
easing.type: Easing.InOutQuad
|
easing.type: Easing.OutQuad
|
||||||
|
easing.amplitude: 2.0
|
||||||
}
|
}
|
||||||
|
|
||||||
PC3.Label {
|
PC3.Label {
|
||||||
|
|
@ -170,6 +179,16 @@ Item {
|
||||||
bottomMargin: root.bottomPadding
|
bottomMargin: root.bottomPadding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opacity: {
|
||||||
|
if (root.status == AppDrawer.Status.Open) {
|
||||||
|
return 1;
|
||||||
|
} else if (root.status == AppDrawer.Status.Closed) {
|
||||||
|
return 0;
|
||||||
|
} else { // peeking
|
||||||
|
return (1 - view.contentY / -view.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
visible: root.status !== AppDrawer.Status.Closed
|
visible: root.status !== AppDrawer.Status.Closed
|
||||||
cellWidth: view.width / Math.floor(view.width / ((root.availableCellHeight - root.reservedSpaceForLabel) + units.smallSpacing*4))
|
cellWidth: view.width / Math.floor(view.width / ((root.availableCellHeight - root.reservedSpaceForLabel) + units.smallSpacing*4))
|
||||||
cellHeight: root.availableCellHeight
|
cellHeight: root.availableCellHeight
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue