fix: watch transform for changes + async dock list
This commit is contained in:
parent
c7a943b1c7
commit
0682397384
3 changed files with 14 additions and 4 deletions
|
|
@ -20,6 +20,7 @@ LazyListView {
|
|||
|
||||
spacing: Appearance.spacing.small
|
||||
cacheBuffer: 200
|
||||
asynchronous: true
|
||||
|
||||
useCustomViewport: true
|
||||
viewport: Qt.rect(0, container.contentY, width, container.height)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue