Async load on timelines/calls history bt keep sync only on first elements.

This commit is contained in:
Julien Wadel 2023-10-24 17:07:07 +02:00
parent 76fdbe857b
commit fa824ac78a
2 changed files with 31 additions and 23 deletions

View file

@ -122,19 +122,23 @@ ColumnLayout{
| (outgoingFilter.checked ? CallHistoryProxyModel.Outgoing : 0)
| (missedFilter.checked ? CallHistoryProxyModel.Missed : 0)
}
delegate: CallTimelineItem{
callHistoryModel: $modelData
modelIndex: index
Connections{
target: $modelData
onSelectedChanged:{
if(selected) {
view.currentIndex = index;
mainItem.entrySelected(model)
delegate: Loader{
width: view.contentWidth
asynchronous: index > 20
active: true
sourceComponent: CallTimelineItem{
callHistoryModel: $modelData
modelIndex: index
Connections{
target: $modelData
onSelectedChanged:{
if(selected) {
view.currentIndex = index;
mainItem.entrySelected(model)
}
}
}
}
}
}
}
}

View file

@ -149,18 +149,22 @@ Rectangle {
filterFlags: (secureFilter.checked ? TimelineProxyModel.SecureChatRoom : 0)
| (chatGroupFilter.checked ? TimelineProxyModel.GroupChatRoom : 0)
}
delegate: TimelineItem{
timelineModel: $modelData
modelIndex: index
optionsTogglable: timeline.optionsTogglable
actions: timeline.actions
Connections{
target: $modelData
onSelectedChanged:{
if(selected) {
view.currentIndex = index;
delegate: Loader{
width: view.contentWidth
asynchronous: index > 20
active: true
sourceComponent: TimelineItem{
timelineModel: $modelData
modelIndex: index
optionsTogglable: timeline.optionsTogglable
actions: timeline.actions
Connections{
target: $modelData
onSelectedChanged:{
if(selected) {
view.currentIndex = index;
}
}
}
}