summary refs log tree commit diff
path: root/resources/qml/TimelineView.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-05-26 22:27:05 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-05-26 22:54:51 +0200
commitf452bdf2b01ca6c39bdb3ecd4f61ec1eb1eef211 (patch)
tree42281470d39f726b69eeedfb1ff3055935414fe4 /resources/qml/TimelineView.qml
parentImprove compile times a tiny bit (diff)
downloadnheko-f452bdf2b01ca6c39bdb3ecd4f61ec1eb1eef211.tar.xz
Make settings update immediately in qml and allow limiting timeline width
Limiting improves readability on wide monitors.

The immediate update of the settings is done by just exposing settings
as properties and then setting the settings as a context property.
Diffstat (limited to 'resources/qml/TimelineView.qml')
-rw-r--r--resources/qml/TimelineView.qml33
1 files changed, 9 insertions, 24 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 145a82ce..08130033 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -3,7 +3,6 @@ import QtQuick.Controls 2.3
 import QtQuick.Layouts 1.2
 import QtGraphicalEffects 1.0
 import QtQuick.Window 2.2
-import Qt.labs.settings 1.0
 
 import im.nheko 1.0
 
@@ -21,22 +20,6 @@ Page {
 		id: fontMetrics
 	}
 
-	Settings {
-		id: settings
-		category: "user"
-		property bool avatar_circles: true
-		property string emoji_font_family: "default"
-		property double font_size: Qt.application.font.pointSize
-	}
-
-	Settings {
-		id: timelineSettings
-		category: "user/timeline"
-		property bool buttons: true
-		property bool message_hover_highlight: false
-		property bool enlarge_emoji_only_msg: false
-	}
-
 	Menu {
 		id: messageContextMenu
 		modal: true
@@ -102,7 +85,7 @@ Page {
 		BusyIndicator {
 			visible: running
 			anchors.centerIn: parent
-            running: timelineManager.isInitialSync
+			running: timelineManager.isInitialSync
 			height: 200
 			width: 200
 			z: 3
@@ -113,12 +96,12 @@ Page {
 
 			visible: timelineManager.timeline != null
 
-			cacheBuffer: 500
+			cacheBuffer: 400
 
-			anchors.left: parent.left
-			anchors.right: parent.right
+			anchors.horizontalCenter: parent.horizontalCenter
 			anchors.top: parent.top
 			anchors.bottom: chatFooter.top
+			width: parent.width
 
 			anchors.leftMargin: 4
 			anchors.rightMargin: scrollbar.width
@@ -160,7 +143,7 @@ Page {
 				id: scrollbar
 				parent: chat.parent
 				anchors.top: chat.top
-				anchors.left: chat.right
+				anchors.right: chat.right
 				anchors.bottom: chat.bottom
 			}
 
@@ -175,7 +158,8 @@ Page {
 
 				id: wrapper
 				property Item section
-				width: chat.width
+				anchors.horizontalCenter: parent.horizontalCenter
+				width: (settings.timelineMaxWidth > 100 && (parent.width - settings.timelineMaxWidth) > 32) ? settings.timelineMaxWidth : (parent.width - 32)
 				height: section ? section.height + timelinerow.height : timelinerow.height
 				color: "transparent"
 
@@ -245,7 +229,8 @@ Page {
 					}
 					Row {
 						height: userName.height
-                        spacing: 4
+						spacing: 8
+
 						Avatar {
 							width: avatarSize
 							height: avatarSize