File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,16 @@ Rectangle {
262262 contentY = Math .min (originY + contentHeight - height,
263263 contentY + height)
264264 }
265+ function onWheel (wheel ) {
266+ var yDelta = wheel .angleDelta .y / 120 * 100
267+
268+ if (yDelta > 0 ) {
269+ contentY = Math .max (originY, contentY - yDelta)
270+ } else {
271+ contentY = Math .min (contentY + (originY + contentHeight) - (contentY + height),
272+ contentY + Math .abs (yDelta))
273+ }
274+ }
265275 Connections {
266276 target: controller
267277 onPageUpPressed: chatView .pageUp ()
@@ -353,6 +363,18 @@ Rectangle {
353363 }
354364 }
355365 }
366+ MouseArea {
367+ anchors .fill : chatScrollView
368+ acceptedButtons: Qt .NoButton
369+ onWheel: {
370+ if (wheel .angleDelta .x == 0 ) {
371+ chatView .onWheel (wheel)
372+ wheel .accepted = true
373+ } else {
374+ wheel .accepted = false
375+ }
376+ }
377+ }
356378 Slider {
357379 id: shuttleDial
358380 orientation: Qt .Vertical
You can’t perform that action at this time.
0 commit comments