summary refs log tree commit diff
path: root/resources/qml/TimelineView.qml
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2020-04-29 22:15:53 +0200
committerGitHub <noreply@github.com>2020-04-29 22:15:53 +0200
commit19ec8d261d4028014969ba2d94c692af4c8b4412 (patch)
tree40a581148d75fcf9fadbbaf99dd283629f53401e /resources/qml/TimelineView.qml
parentFix some smaller coloring issues (diff)
parentAddress CR comments (diff)
downloadnheko-19ec8d261d4028014969ba2d94c692af4c8b4412.tar.xz
Merge pull request #183 from shocklateboy92/features/smooth-scroll
Improve scrolling in timeline view
Diffstat (limited to 'resources/qml/TimelineView.qml')
-rw-r--r--resources/qml/TimelineView.qml33
1 files changed, 14 insertions, 19 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 09865d16..c42cd6e9 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -115,21 +115,11 @@ Page {
 			model: timelineManager.timeline
 
 			boundsBehavior: Flickable.StopAtBounds
-			pixelAligned: true
-
-			MouseArea {
-				anchors.fill: parent
-				acceptedButtons: Qt.NoButton
-				propagateComposedEvents: true
-				z: -1
-				onWheel: {
-					if (wheel.angleDelta != 0) {
-						chat.contentY = chat.contentY - wheel.angleDelta.y
-						wheel.accepted = true
-						chat.returnToBounds()
-					}
-				}
-			}
+
+            ScrollHelper {
+                flickable: parent
+                anchors.fill: parent
+            }
 
 			Shortcut {
 				sequence: StandardKey.MoveToPreviousPage
@@ -218,9 +208,10 @@ Page {
 						text: chat.model.formatDateSeparator(modelData.timestamp)
 						color: colors.brightText
 
-						height: contentHeight * 1.2
-						width: contentWidth * 1.2
-						horizontalAlignment: Text.AlignHCenter
+                        height: fontMetrics.height * 1.4
+                        width: contentWidth * 1.2
+
+                        horizontalAlignment: Text.AlignHCenter
 						background: Rectangle {
 							radius: parent.height / 2
 							color: colors.dark
@@ -228,7 +219,7 @@ Page {
 					}
 					Row {
 						height: userName.height
-						spacing: 4
+                        spacing: 4
 						Avatar {
 							width: avatarSize
 							height: avatarSize
@@ -335,4 +326,8 @@ Page {
 			}
 		}
 	}
+
+    FontMetrics {
+        id: fontMetrics
+    }
 }