diff --git a/modules/sidebar/NotifDockList.qml b/modules/sidebar/NotifDockList.qml index 11dde291..3c6a5398 100644 --- a/modules/sidebar/NotifDockList.qml +++ b/modules/sidebar/NotifDockList.qml @@ -20,6 +20,7 @@ LazyListView { spacing: Appearance.spacing.small cacheBuffer: 200 + asynchronous: true useCustomViewport: true viewport: Qt.rect(0, container.contentY, width, container.height) diff --git a/modules/sidebar/NotifGroup.qml b/modules/sidebar/NotifGroup.qml index f1d1502f..0efea542 100644 --- a/modules/sidebar/NotifGroup.qml +++ b/modules/sidebar/NotifGroup.qml @@ -52,7 +52,7 @@ StyledRect { readonly property int nonAnimHeight: { const headerHeight = header.implicitHeight + (root.expanded ? Math.round(Appearance.spacing.small / 2) : 0); - const columnHeight = headerHeight + notifList.nonAnimHeight + column.Layout.topMargin + column.Layout.bottomMargin; + const columnHeight = headerHeight + notifList.layoutHeight + column.Layout.topMargin + column.Layout.bottomMargin; return Math.round(Math.max(Config.notifs.sizes.image, columnHeight) + Appearance.padding.normal * 2); } readonly property bool expanded: props.expandedNotifs.includes(modelData) diff --git a/modules/sidebar/NotifGroupList.qml b/modules/sidebar/NotifGroupList.qml index a54a13b6..a4401697 100644 --- a/modules/sidebar/NotifGroupList.qml +++ b/modules/sidebar/NotifGroupList.qml @@ -17,8 +17,6 @@ LazyListView { required property Flickable container required property DrawerVisibilities visibilities - readonly property real nonAnimHeight: layoutHeight - signal requestToggleExpand(expand: bool) Layout.fillWidth: true @@ -27,10 +25,14 @@ LazyListView { spacing: Math.round(Appearance.spacing.small / 2) asynchronous: true + cacheBuffer: 200 removeDuration: Appearance.anim.durations.normal useCustomViewport: true - viewport: Qt.rect(0, container.contentY - mapToItem(container.contentItem, 0, 0).y, width, container.height) + viewport: { + tWatcher.transform; // mapToItem is not reactive so use this to trigger updates + return Qt.rect(0, container.contentY - mapToItem(container.contentItem, 0, 0).y, width, container.height); + } model: ScriptModel { values: root.expanded ? root.notifs : root.notifs.slice(0, Config.notifs.groupPreviewNum + 1) @@ -145,4 +147,11 @@ LazyListView { } } } + + TransformWatcher { + id: tWatcher + + a: root.container.contentItem + b: root + } }