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 QtQuick.Window 2.2
import im.nheko 1.0 import im.nheko 1.0
ScrollView {
contentWidth: availableWidth
clip: false
palette: colors
padding: 8
ListView { ListView {
id: chat 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 model: TimelineManager.timeline
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
pixelAligned: true pixelAligned: true
@ -174,10 +178,6 @@ ListView {
} }
ScrollBar.vertical: ScrollBar {
id: scrollbar
}
delegate: Item { delegate: Item {
id: wrapper id: wrapper
@ -223,3 +223,5 @@ ListView {
} }
} }
}