forked from Shinonome/dots-hyprland
notifications: adjust animations
This commit is contained in:
@@ -22,6 +22,8 @@ Item {
|
|||||||
property bool ready: false
|
property bool ready: false
|
||||||
property int defaultTimeoutValue: 5000
|
property int defaultTimeoutValue: 5000
|
||||||
|
|
||||||
|
property var notificationXAnimation: Appearance.animation.elementMoveEnter
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
clip: !popup
|
clip: !popup
|
||||||
|
|
||||||
@@ -45,6 +47,7 @@ Item {
|
|||||||
interval: notificationObject.expireTimeout ?? root.defaultTimeoutValue
|
interval: notificationObject.expireTimeout ?? root.defaultTimeoutValue
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
root.notificationXAnimation = Appearance.animation.elementMoveExit
|
||||||
Notifications.timeoutNotification(notificationObject.id);
|
Notifications.timeoutNotification(notificationObject.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,9 +138,11 @@ Item {
|
|||||||
dragStarted = false
|
dragStarted = false
|
||||||
if (mouse.button === Qt.LeftButton) {
|
if (mouse.button === Qt.LeftButton) {
|
||||||
if (notificationRowWrapper.x > dragConfirmThreshold) {
|
if (notificationRowWrapper.x > dragConfirmThreshold) {
|
||||||
|
root.notificationXAnimation = Appearance.animation.elementMoveEnter
|
||||||
Notifications.discardNotification(notificationObject.id);
|
Notifications.discardNotification(notificationObject.id);
|
||||||
} else {
|
} else {
|
||||||
// Animate back if not far enough
|
// Animate back if not far enough
|
||||||
|
root.notificationXAnimation = Appearance.animation.elementMoveFast
|
||||||
notificationRowWrapper.x = 0
|
notificationRowWrapper.x = 0
|
||||||
notificationBackground.x = 0
|
notificationBackground.x = 0
|
||||||
}
|
}
|
||||||
@@ -188,9 +193,9 @@ Item {
|
|||||||
Behavior on x {
|
Behavior on x {
|
||||||
enabled: enableAnimation
|
enabled: enableAnimation
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Appearance.animation.elementMoveFast.duration
|
duration: root.notificationXAnimation.duration
|
||||||
easing.type: Appearance.animation.elementMoveFast.type
|
easing.type: root.notificationXAnimation.type
|
||||||
easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve
|
easing.bezierCurve: root.notificationXAnimation.bezierCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
@@ -228,9 +233,9 @@ Item {
|
|||||||
Behavior on x {
|
Behavior on x {
|
||||||
enabled: enableAnimation
|
enabled: enableAnimation
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Appearance.animation.elementMoveFast.duration
|
duration: root.notificationXAnimation.duration
|
||||||
easing.type: Appearance.animation.elementMoveFast.type
|
easing.type: root.notificationXAnimation.type
|
||||||
easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve
|
easing.bezierCurve: root.notificationXAnimation.bezierCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user