mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-13 17:22:08 -04:00
notifications: cap max anim speed in popout
This commit is contained in:
@@ -12,6 +12,7 @@ DankListView {
|
|||||||
property bool isAnimatingExpansion: false
|
property bool isAnimatingExpansion: false
|
||||||
property alias count: listView.count
|
property alias count: listView.count
|
||||||
property alias listContentHeight: listView.contentHeight
|
property alias listContentHeight: listView.contentHeight
|
||||||
|
property bool cardAnimateExpansion: true
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
model: NotificationService.groupedNotifications
|
model: NotificationService.groupedNotifications
|
||||||
@@ -88,6 +89,7 @@ DankListView {
|
|||||||
x: delegateRoot.swipeOffset
|
x: delegateRoot.swipeOffset
|
||||||
notificationGroup: modelData
|
notificationGroup: modelData
|
||||||
keyboardNavigationActive: listView.keyboardActive
|
keyboardNavigationActive: listView.keyboardActive
|
||||||
|
animateExpansion: listView.cardAnimateExpansion
|
||||||
opacity: 1 - Math.abs(delegateRoot.swipeOffset) / (delegateRoot.width * 0.5)
|
opacity: 1 - Math.abs(delegateRoot.swipeOffset) / (delegateRoot.width * 0.5)
|
||||||
onIsAnimatingChanged: {
|
onIsAnimatingChanged: {
|
||||||
if (isAnimating) {
|
if (isAnimating) {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Rectangle {
|
|||||||
property bool descriptionExpanded: (NotificationService.expandedMessages[(notificationGroup && notificationGroup.latestNotification && notificationGroup.latestNotification.notification && notificationGroup.latestNotification.notification.id) ? (notificationGroup.latestNotification.notification.id + "_desc") : ""] || false)
|
property bool descriptionExpanded: (NotificationService.expandedMessages[(notificationGroup && notificationGroup.latestNotification && notificationGroup.latestNotification.notification && notificationGroup.latestNotification.notification.id) ? (notificationGroup.latestNotification.notification.id + "_desc") : ""] || false)
|
||||||
property bool userInitiatedExpansion: false
|
property bool userInitiatedExpansion: false
|
||||||
property bool isAnimating: false
|
property bool isAnimating: false
|
||||||
|
property bool animateExpansion: true
|
||||||
|
|
||||||
property bool isGroupSelected: false
|
property bool isGroupSelected: false
|
||||||
property int selectedNotificationIndex: -1
|
property int selectedNotificationIndex: -1
|
||||||
@@ -715,7 +716,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
enabled: root.userInitiatedExpansion
|
enabled: root.userInitiatedExpansion && root.animateExpansion
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.mediumDuration
|
duration: Theme.mediumDuration
|
||||||
easing.type: Theme.emphasizedEasing
|
easing.type: Theme.emphasizedEasing
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ DankPopout {
|
|||||||
|
|
||||||
property bool notificationHistoryVisible: false
|
property bool notificationHistoryVisible: false
|
||||||
property var triggerScreen: null
|
property var triggerScreen: null
|
||||||
|
property bool _animatePopupHeight: false
|
||||||
|
|
||||||
NotificationKeyboardController {
|
NotificationKeyboardController {
|
||||||
id: keyboardController
|
id: keyboardController
|
||||||
@@ -23,6 +24,14 @@ DankPopout {
|
|||||||
popupWidth: 400
|
popupWidth: 400
|
||||||
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400
|
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400
|
||||||
positioning: ""
|
positioning: ""
|
||||||
|
|
||||||
|
Behavior on popupHeight {
|
||||||
|
enabled: root._animatePopupHeight
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Math.min(Theme.shortDuration, 150)
|
||||||
|
easing.type: Theme.emphasizedEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
shouldBeVisible: notificationHistoryVisible
|
shouldBeVisible: notificationHistoryVisible
|
||||||
|
|
||||||
@@ -72,10 +81,13 @@ DankPopout {
|
|||||||
|
|
||||||
onShouldBeVisibleChanged: {
|
onShouldBeVisibleChanged: {
|
||||||
if (shouldBeVisible) {
|
if (shouldBeVisible) {
|
||||||
|
_animatePopupHeight = false;
|
||||||
NotificationService.onOverlayOpen();
|
NotificationService.onOverlayOpen();
|
||||||
if (contentLoader.item)
|
if (contentLoader.item)
|
||||||
Qt.callLater(setupKeyboardNavigation);
|
Qt.callLater(setupKeyboardNavigation);
|
||||||
|
Qt.callLater(() => { root._animatePopupHeight = true; });
|
||||||
} else {
|
} else {
|
||||||
|
_animatePopupHeight = false;
|
||||||
NotificationService.onOverlayClose();
|
NotificationService.onOverlayClose();
|
||||||
keyboardController.keyboardNavigationActive = false;
|
keyboardController.keyboardNavigationActive = false;
|
||||||
}
|
}
|
||||||
@@ -198,6 +210,7 @@ DankPopout {
|
|||||||
visible: notificationHeader.currentTab === 0
|
visible: notificationHeader.currentTab === 0
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height - notificationContent.cachedHeaderHeight - notificationSettings.height - contentColumnInner.spacing * 2
|
height: parent.height - notificationContent.cachedHeaderHeight - notificationSettings.height - contentColumnInner.spacing * 2
|
||||||
|
cardAnimateExpansion: false
|
||||||
}
|
}
|
||||||
|
|
||||||
HistoryNotificationList {
|
HistoryNotificationList {
|
||||||
|
|||||||
@@ -19,18 +19,16 @@ Rectangle {
|
|||||||
|
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Anims.durShort
|
duration: Theme.shortDuration
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Theme.emphasizedEasing
|
||||||
easing.bezierCurve: Anims.emphasized
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
opacity: expanded ? 1 : 0
|
opacity: expanded ? 1 : 0
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Anims.durShort
|
duration: Theme.shortDuration
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Theme.emphasizedEasing
|
||||||
easing.bezierCurve: Anims.emphasized
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user