From e492b0adaba6cda339cd78d2759250897897e1ae Mon Sep 17 00:00:00 2001 From: Nydragon Date: Mon, 25 Nov 2024 18:10:07 +0100 Subject: [PATCH] feat: add animation to inbox --- src/ClockWidget.qml | 4 +++- src/Dashboard.qml | 4 +++- .../notifications/NotificationInbox.qml | 24 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/ClockWidget.qml b/src/ClockWidget.qml index 62af52d..eaf4d6b 100644 --- a/src/ClockWidget.qml +++ b/src/ClockWidget.qml @@ -5,11 +5,13 @@ import "base" BRectangle { height: clock.height * 1.5 - Rectangle { + Item { id: clock height: hours.height + minutes.height + width: parent.width anchors.centerIn: parent anchors.verticalCenter: parent.verticalCenter + Text { id: hours anchors.horizontalCenter: parent.horizontalCenter diff --git a/src/Dashboard.qml b/src/Dashboard.qml index 1b08015..2f85d55 100644 --- a/src/Dashboard.qml +++ b/src/Dashboard.qml @@ -51,7 +51,7 @@ PanelWindow { topRightRadius: 10 border.color: "transparent" height: parent.height - width: NyshState.dashOpen ? maxSize : 0 + width: NyshState.dashOpen ? maxSize : 1 clip: true MouseArea { anchors.fill: parent @@ -83,6 +83,7 @@ PanelWindow { Layout.fillHeight: true Layout.fillWidth: true height: parent.height + width: parent.width Layout.margins: 15 clip: true @@ -101,6 +102,7 @@ PanelWindow { Layout.fillHeight: true Layout.fillWidth: true height: parent.height + width: parent.width Layout.margins: 15 Layout.alignment: Qt.AlignBottom diff --git a/src/widgets/notifications/NotificationInbox.qml b/src/widgets/notifications/NotificationInbox.qml index e1903da..bce7520 100644 --- a/src/widgets/notifications/NotificationInbox.qml +++ b/src/widgets/notifications/NotificationInbox.qml @@ -26,4 +26,28 @@ ListView { toast.notif.dismiss(); } } + + addDisplaced: Transition { + NumberAnimation { + properties: "x,y" + duration: 100 + } + } + remove: Transition { + PropertyAction { + property: "ListView.delayRemove" + value: true + } + ParallelAnimation { + NumberAnimation { + property: "opacity" + to: 0 + duration: 200 + } + } + PropertyAction { + property: "ListView.delayRemove" + value: true + } + } }