Fix & improve keyboard and mousewheel flicking

This commit is contained in:
miruka
2019-12-10 11:49:46 -04:00
parent 2eadaff542
commit ad6f111793
5 changed files with 61 additions and 45 deletions

View File

@@ -61,7 +61,7 @@ Rectangle {
HListView {
id: eventList
clip: true
enableFlicking: false
allowDragging: false
anchors.fill: parent
anchors.leftMargin: theme.spacing
@@ -92,8 +92,6 @@ Rectangle {
property bool ownEventsOnRight:
width < theme.chat.eventList.ownEventsOnRightUnderWidth
property alias cursorShape: mouseArea.cursorShape
function canCombine(item, itemAfter) {
if (! item || ! itemAfter) return false
@@ -160,19 +158,6 @@ Rectangle {
}
delegate: EventDelegate {}
MouseArea {
id: mouseArea
anchors.fill: parent
acceptedButtons: Qt.NoButton
onWheel: Utils.smartVerticalFlick(
eventList,
200 * Qt.styleHints.wheelScrollLines *
(wheel.angleDelta.y < 0 ? 1 : -1),
2,
)
}
}
}