Fix scrolling in RoomPage
This now use the ScrollablePage native scroll effect when the ScrollPage only have one scrollview has child item.
This commit is contained in:
@@ -28,6 +28,7 @@ Kirigami.ScrollablePage {
|
||||
|
||||
title: currentRoom.name
|
||||
|
||||
ListView {
|
||||
MessageEventModel {
|
||||
id: messageEventModel
|
||||
|
||||
@@ -101,8 +102,6 @@ Kirigami.ScrollablePage {
|
||||
return messageEventModel.data(messageEventModel.index(row, 0), MessageEventModel.MessageRole) !== 0x10 && messageEventModel.data(messageEventModel.index(row, 0), MessageEventModel.EventTypeRole) !== "other"
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
readonly property int largestVisibleIndex: count > 0 ? indexAt(contentX + (width / 2), contentY + height - 1) : -1
|
||||
readonly property bool noNeedMoreContent: !currentRoom || currentRoom.eventsHistoryJob || currentRoom.allHistoryLoaded
|
||||
|
||||
@@ -309,10 +308,11 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
QQC2.RoundButton {
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 16
|
||||
anchors.topMargin: Kirigami.Units.largeSpacing
|
||||
anchors.rightMargin: Kirigami.Units.largeSpacing
|
||||
|
||||
padding: 8
|
||||
|
||||
@@ -356,7 +356,6 @@ Kirigami.ScrollablePage {
|
||||
|
||||
positionViewAtBeginning()
|
||||
}
|
||||
}
|
||||
|
||||
DropArea {
|
||||
id: dropAreaFile
|
||||
@@ -378,6 +377,19 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: messageDelegateContextMenu
|
||||
|
||||
MessageDelegateContextMenu {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: messageSourceSheet
|
||||
|
||||
MessageSourceSheet {}
|
||||
}
|
||||
}
|
||||
|
||||
footer: ChatTextInput {
|
||||
id: chatTextInput
|
||||
Layout.fillWidth: true
|
||||
@@ -432,16 +444,4 @@ Kirigami.ScrollablePage {
|
||||
})
|
||||
contextMenu.open()
|
||||
}
|
||||
|
||||
Component {
|
||||
id: messageDelegateContextMenu
|
||||
|
||||
MessageDelegateContextMenu {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: messageSourceSheet
|
||||
|
||||
MessageSourceSheet {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user