Revert "Remove ScrollHelper. Scrolling is fixed in Qt upstream."
This reverts commit 059d8da6b2
This commit is contained in:
@@ -172,7 +172,7 @@ Drawer {
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
AutoListView {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
@@ -180,8 +180,6 @@ Drawer {
|
||||
|
||||
clip: true
|
||||
|
||||
pixelAligned: true
|
||||
|
||||
boundsBehavior: Flickable.DragOverBounds
|
||||
|
||||
model: UserListModel {
|
||||
|
||||
@@ -185,7 +185,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
AutoListView {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
@@ -197,8 +197,6 @@ Item {
|
||||
|
||||
model: sortedRoomListModel
|
||||
|
||||
pixelAligned: true
|
||||
|
||||
boundsBehavior: Flickable.DragOverBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
@@ -223,7 +223,7 @@ Item {
|
||||
|
||||
spacing: 16
|
||||
|
||||
ListView {
|
||||
AutoListView {
|
||||
readonly property int largestVisibleIndex: count > 0 ? indexAt(contentX + (width / 2), contentY + height - 1) : -1
|
||||
readonly property bool noNeedMoreContent: !currentRoom || currentRoom.eventsHistoryJob || currentRoom.allHistoryLoaded
|
||||
|
||||
@@ -241,8 +241,6 @@ Item {
|
||||
|
||||
boundsBehavior: Flickable.DragOverBounds
|
||||
|
||||
pixelAligned: true
|
||||
|
||||
model: SortFilterProxyModel {
|
||||
id: sortedMessageEventModel
|
||||
|
||||
@@ -256,10 +254,16 @@ Item {
|
||||
|
||||
onModelReset: {
|
||||
movingTimer.stop()
|
||||
messageListView.positionViewAtBeginning()
|
||||
if (currentRoom) {
|
||||
movingTimer.restart()
|
||||
|
||||
var lastScrollPosition = sortedMessageEventModel.mapFromSource(currentRoom.savedTopVisibleIndex())
|
||||
if (lastScrollPosition === 0) {
|
||||
messageListView.positionViewAtBeginning()
|
||||
} else {
|
||||
messageListView.currentIndex = lastScrollPosition
|
||||
}
|
||||
|
||||
if (messageListView.contentY < messageListView.originY + 10 || currentRoom.timelineSize < 20)
|
||||
currentRoom.getPreviousContent(50)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user