2020-05-27 22:59:17 +00:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import QtQuick.Controls 2.12 as QQC2
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import Qt.labs.platform 1.1
|
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../imports"
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: chatLogView
|
|
|
|
model: chatsModel.messageList
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2020-05-28 15:55:52 +00:00
|
|
|
delegate: Message {
|
|
|
|
userName: model.userName
|
|
|
|
message: model.message
|
|
|
|
identicon: model.identicon
|
|
|
|
isCurrentUser: model.isCurrentUser
|
|
|
|
repeatMessageInfo: model.repeatMessageInfo
|
|
|
|
timestamp: model.timestamp
|
|
|
|
}
|
2020-05-27 22:59:17 +00:00
|
|
|
highlightFollowsCurrentItem: true
|
|
|
|
|
|
|
|
onCountChanged: {
|
|
|
|
if (!this.atYEnd) {
|
|
|
|
// User has scrolled up, we don't want to scroll back
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// positionViewAtEnd doesn't work well. Instead, we use highlightFollowsCurrentItem
|
|
|
|
// and set the current Item/Index to the latest item
|
|
|
|
while (this.currentIndex < this.count - 1) {
|
|
|
|
this.incrementCurrentIndex()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-28 15:55:52 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;autoSize:true;height:480;width:640}
|
|
|
|
}
|
|
|
|
##^##*/
|