fix: notif group collapse lag
It sort of breaks the anim but it's a worthwhile tradeoff Without this it is just wayyy too laggy with large amounts of notifs
This commit is contained in:
parent
08809320de
commit
2fbdfad472
1 changed files with 2 additions and 20 deletions
|
|
@ -16,19 +16,9 @@ LazyListView {
|
||||||
required property DrawerVisibilities visibilities
|
required property DrawerVisibilities visibilities
|
||||||
|
|
||||||
readonly property real nonAnimHeight: layoutHeight
|
readonly property real nonAnimHeight: layoutHeight
|
||||||
property bool showAllNotifs
|
|
||||||
|
|
||||||
signal requestToggleExpand(expand: bool)
|
signal requestToggleExpand(expand: bool)
|
||||||
|
|
||||||
onExpandedChanged: {
|
|
||||||
if (expanded) {
|
|
||||||
clearTimer.stop();
|
|
||||||
showAllNotifs = true;
|
|
||||||
} else {
|
|
||||||
clearTimer.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
|
|
||||||
|
|
@ -38,18 +28,10 @@ LazyListView {
|
||||||
removeDuration: Appearance.anim.durations.normal
|
removeDuration: Appearance.anim.durations.normal
|
||||||
|
|
||||||
useCustomViewport: true
|
useCustomViewport: true
|
||||||
viewport: Qt.rect(0, container.contentY - mapToItem(container.contentItem, 0, 0).y,
|
viewport: Qt.rect(0, container.contentY - mapToItem(container.contentItem, 0, 0).y, width, container.height)
|
||||||
width, container.height)
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: clearTimer
|
|
||||||
|
|
||||||
interval: Appearance.anim.durations.normal
|
|
||||||
onTriggered: root.showAllNotifs = false
|
|
||||||
}
|
|
||||||
|
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: root.showAllNotifs ? root.notifs : root.notifs.slice(0, Config.notifs.groupPreviewNum + 1)
|
values: root.expanded ? root.notifs : root.notifs.slice(0, Config.notifs.groupPreviewNum + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: Component {
|
delegate: Component {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue