Improve scroll to message a bit by using a ScrollView

This commit is contained in:
Nicolas Werner 2021-02-13 23:52:45 +01:00
parent ca237f36b9
commit 0d61f4bff1

View file

@ -6,13 +6,17 @@ import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import im.nheko 1.0
ListView {
ScrollView {
contentWidth: availableWidth
clip: false
palette: colors
padding: 8
ListView {
id: chat
property int delegateMaxWidth: (Settings.timelineMaxWidth > 100 && (parent.width - Settings.timelineMaxWidth) > scrollbar.width * 2) ? Settings.timelineMaxWidth : (parent.width - scrollbar.width * 2 - 8)
property int delegateMaxWidth: ((Settings.timelineMaxWidth > 100 && Settings.timelineMaxWidth < parent.availableWidth) ? Settings.timelineMaxWidth : parent.availableWidth) - parent.padding
Layout.fillWidth: true
Layout.fillHeight: true
model: TimelineManager.timeline
boundsBehavior: Flickable.StopAtBounds
pixelAligned: true
@ -174,10 +178,6 @@ ListView {
}
ScrollBar.vertical: ScrollBar {
id: scrollbar
}
delegate: Item {
id: wrapper
@ -222,4 +222,6 @@ ListView {
z: 3
}
}
}