Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions client/qml/Timeline.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
14 changes: 13 additions & 1 deletion client/qml/TimelineItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -138,13 +142,21 @@ Item {
width: parent.width

sourceComponent: detailsArea

TimelineMouseArea {
anchors.fill: parent
}
}

Item {
id: message
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"):
Expand Down
5 changes: 5 additions & 0 deletions client/qml/TimelineMouseArea.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import QtQuick 2.2

MouseArea {
onWheel: chatView.onWheel(wheel)
}
1 change: 1 addition & 0 deletions client/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<file>qml/FileContent.qml</file>
<file>qml/TimelineItem.qml</file>
<file>qml/ActiveLabel.qml</file>
<file>qml/TimelineMouseArea.qml</file>
</qresource>
</RCC>