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:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user