diff --git a/client/qml/Timeline.qml b/client/qml/Timeline.qml
index 285b268e3..2fb6b82dd 100644
--- a/client/qml/Timeline.qml
+++ b/client/qml/Timeline.qml
@@ -262,6 +262,21 @@ Rectangle {
contentY = Math.min(originY + contentHeight - height,
contentY + height)
}
+ function onWheel(wheel) {
+ if (wheel.angleDelta.x == 0) {
+ var yDelta = wheel.angleDelta.y / 120 * 100
+
+ if (yDelta > 0) {
+ contentY = Math.max(originY, contentY - yDelta)
+ } else {
+ contentY = Math.min(contentY + (originY + contentHeight) - (contentY + height),
+ contentY + Math.abs(yDelta))
+ }
+ wheel.accepted = true
+ } else {
+ wheel.accepted = false
+ }
+ }
Connections {
target: controller
onPageUpPressed: chatView.pageUp()
diff --git a/client/qml/TimelineItem.qml b/client/qml/TimelineItem.qml
index 74a1f2666..a96da2be6 100644
--- a/client/qml/TimelineItem.qml
+++ b/client/qml/TimelineItem.qml
@@ -120,14 +120,18 @@ Item {
Rectangle {
width: parent.width
- height: childrenRect.height + 2
+ height: sectionLabel.height + 2
visible: sectionVisible
color: defaultPalette.window
Label {
+ id: sectionLabel
font.bold: true
renderType: settings.render_type
text: section
}
+ TimelineMouseArea {
+ anchors.fill: parent
+ }
}
Loader {
id: detailsAreaLoader
@@ -138,6 +142,10 @@ Item {
width: parent.width
sourceComponent: detailsArea
+
+ TimelineMouseArea {
+ anchors.fill: parent
+ }
}
Item {
@@ -145,6 +153,10 @@ Item {
width: parent.width
height: childrenRect.height
+ TimelineMouseArea {
+ anchors.fill: parent
+ }
+
// There are several layout styles (av - author avatar,
// al - author label, ts - timestamp, c - content
// default (when "timeline_style" is not "xchat"):
diff --git a/client/qml/TimelineMouseArea.qml b/client/qml/TimelineMouseArea.qml
new file mode 100644
index 000000000..522d80962
--- /dev/null
+++ b/client/qml/TimelineMouseArea.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.2
+
+MouseArea {
+ onWheel: chatView.onWheel(wheel)
+}
diff --git a/client/resources.qrc b/client/resources.qrc
index 78bb4a174..00b83bfec 100644
--- a/client/resources.qrc
+++ b/client/resources.qrc
@@ -14,5 +14,6 @@
qml/FileContent.qml
qml/TimelineItem.qml
qml/ActiveLabel.qml
+ qml/TimelineMouseArea.qml