Rearrange scroll bar.

Fixes #3.
This commit is contained in:
Black Hat 2018-08-05 00:15:58 +08:00
parent d1d7139f4b
commit 0e34fce4a2
1 changed files with 68 additions and 54 deletions

View File

@ -74,15 +74,21 @@ Item {
} }
} }
ListView {
id: messageListView
z: -10
RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.rightMargin: 16
z: -10
spacing: 0
ListView {
id: messageListView
Layout.fillWidth: true
Layout.fillHeight: true
displayMarginBeginning: 40 displayMarginBeginning: 40
displayMarginEnd: 40 displayMarginEnd: 40
verticalLayoutDirection: ListView.BottomToTop verticalLayoutDirection: ListView.BottomToTop
@ -117,11 +123,11 @@ Item {
} }
} }
ScrollBar.vertical: messageListViewScrollBar
onAtYBeginningChanged: atYBeginning && currentRoom ? currentRoom.getPreviousContent(50) : {} onAtYBeginningChanged: atYBeginning && currentRoom ? currentRoom.getPreviousContent(50) : {}
onAtYEndChanged: atYEnd && currentRoom ? currentRoom.markAllMessagesAsRead() : {} onAtYEndChanged: atYEnd && currentRoom ? currentRoom.markAllMessagesAsRead() : {}
ScrollBar.vertical: ScrollBar {}
RoundButton { RoundButton {
id: goTopFab id: goTopFab
width: height width: height
@ -146,6 +152,14 @@ Item {
} }
} }
ScrollBar {
id: messageListViewScrollBar
Layout.preferredWidth: 16
Layout.fillHeight: true
}
}
Pane { Pane {
padding: 16 padding: 16