mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-19 20:48:09 +00:00
Chat loading : sync load on "visible" (estimate) items. Load more entries if visible area can contain more than current entries on first display.
This commit is contained in:
parent
5e6b8303b1
commit
cf7f3d3af8
3 changed files with 14 additions and 4 deletions
|
|
@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Display video thumbnails.
|
||||
- Crop thumbnail and pictures if distored.
|
||||
- Enable registration from accounts list.
|
||||
- Update SDK to 5.2.88
|
||||
- Update SDK to 5.2.89
|
||||
|
||||
### Removed
|
||||
- Picture zoom on mouse over.
|
||||
|
|
|
|||
|
|
@ -67,7 +67,8 @@ Rectangle {
|
|||
|
||||
// Load optimizations
|
||||
property int remainingLoadersCount: 0
|
||||
property int syncLoaderBatch: 20 // batch of simultaneous loaders on synchronous mode
|
||||
property int visibleItemsEstimation: chat.height / (2 * textMetrics.height) // Title + body
|
||||
property int syncLoaderBatch: visibleItemsEstimation // batch of simultaneous loaders on synchronous mode
|
||||
//------------------------------------
|
||||
|
||||
signal refreshContents()
|
||||
|
|
@ -93,6 +94,11 @@ Rectangle {
|
|||
running: false
|
||||
onTriggered: chat.refreshContents()
|
||||
}
|
||||
TextMetrics{
|
||||
id: textMetrics
|
||||
font: SettingsModel.textMessageFont
|
||||
text: "X"
|
||||
}
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -110,6 +116,9 @@ Rectangle {
|
|||
Component.onCompleted: {
|
||||
Logic.initView()
|
||||
refreshContentsTimer.start()
|
||||
console.debug("Chat loading with "+chat.visibleItemsEstimation+" visible items. "+chat.count)
|
||||
if(chat.visibleItemsEstimation >= chat.count)
|
||||
Qt.callLater(container.proxyModel.loadMoreEntriesAsync)
|
||||
}
|
||||
onMovementStarted: {Logic.handleMovementStarted(); chat.isMoving = true}
|
||||
onMovementEnded: {Logic.handleMovementEnded(); chat.isMoving = false}
|
||||
|
|
@ -235,7 +244,8 @@ Rectangle {
|
|||
Layout.fillWidth: true
|
||||
source: Logic.getComponentFromEntry(entry.chatEntry)
|
||||
z:1
|
||||
asynchronous: index != chat.count - 1
|
||||
|
||||
asynchronous: index < chat.count - 1 - chat.visibleItemsEstimation
|
||||
property int loaderIndex: 0
|
||||
function updateSync(){
|
||||
if( asynchronous && loaderIndex > 0 && chat.remainingLoadersCount - loaderIndex - chat.syncLoaderBatch <= 0 ) asynchronous = false// Sync load the end
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 427cc9848f43e5ed88be897341709ebed79bb354
|
||||
Subproject commit 80e3a7377b6f42f43f46d706a47cc2dea827682b
|
||||
Loading…
Add table
Reference in a new issue