1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-08 23:02:05 -04:00

notifications: Refactor Animations

This commit is contained in:
purian23
2026-02-07 17:25:26 -05:00
parent c4a41f994a
commit 8ee7fe8e66
6 changed files with 55 additions and 28 deletions

View File

@@ -253,6 +253,11 @@ Item {
property real swipeOffset: 0
property bool isDismissing: false
readonly property real dismissThreshold: width * 0.35
property bool __delegateInitialized: false
Component.onCompleted: {
Qt.callLater(() => { __delegateInitialized = true; });
}
width: ListView.view.width
height: historyCard.height
@@ -268,7 +273,7 @@ Item {
opacity: 1 - Math.abs(delegateRoot.swipeOffset) / (delegateRoot.width * 0.5)
Behavior on x {
enabled: !swipeDragHandler.active
enabled: !swipeDragHandler.active && delegateRoot.__delegateInitialized
NumberAnimation {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
@@ -276,8 +281,9 @@ Item {
}
Behavior on opacity {
enabled: delegateRoot.__delegateInitialized
NumberAnimation {
duration: Theme.shortDuration
duration: delegateRoot.__delegateInitialized ? Theme.shortDuration : 0
}
}
}