summary refs log tree commit diff
path: root/resources/qml/delegates
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-06-24 16:24:22 +0200
committerCH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com>2020-07-30 22:10:27 +0530
commit4862be06be6e32c1f4963feabfde010a9f64616c (patch)
tree5349820c286c2f9fbbd1d88ecc9f236fd77e8846 /resources/qml/delegates
parentSome more changes (diff)
downloadnheko-4862be06be6e32c1f4963feabfde010a9f64616c.tar.xz
Fix presence indicator
Diffstat (limited to 'resources/qml/delegates')
-rw-r--r--resources/qml/delegates/FileMessage.qml4
-rw-r--r--resources/qml/delegates/ImageMessage.qml2
-rw-r--r--resources/qml/delegates/MessageDelegate.qml12
-rw-r--r--resources/qml/delegates/PlayableMediaMessage.qml4
-rw-r--r--resources/qml/delegates/Reply.qml4
-rw-r--r--resources/qml/delegates/TextMessage.qml4
6 files changed, 18 insertions, 12 deletions
diff --git a/resources/qml/delegates/FileMessage.qml b/resources/qml/delegates/FileMessage.qml
index d8e4215f..158daf45 100644
--- a/resources/qml/delegates/FileMessage.qml
+++ b/resources/qml/delegates/FileMessage.qml
@@ -1,6 +1,8 @@
 import QtQuick 2.6
 import QtQuick.Layouts 1.2
 
+import im.nheko 1.0
+
 Item {
 	height: row.height + 24
 	width: parent ? parent.width : undefined
@@ -29,7 +31,7 @@ Item {
 			}
 			MouseArea {
 				anchors.fill: parent
-				onClicked: timelineManager.timeline.saveMedia(model.data.id)
+				onClicked: TimelineManager.timeline.saveMedia(model.data.id)
 				cursorShape: Qt.PointingHandCursor
 			}
 		}
diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml
index 3885ddae..b5c51c2c 100644
--- a/resources/qml/delegates/ImageMessage.qml
+++ b/resources/qml/delegates/ImageMessage.qml
@@ -36,7 +36,7 @@ Item {
 		MouseArea {
 			enabled: model.data.type == MtxEvent.ImageMessage && img.status == Image.Ready
 			anchors.fill: parent
-			onClicked: timelineManager.openImageOverlay(model.data.url, model.data.id)
+			onClicked: TimelineManager.openImageOverlay(model.data.url, model.data.id)
 		}
 	}
 }
diff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml
index 9630ae3a..6f69f026 100644
--- a/resources/qml/delegates/MessageDelegate.qml
+++ b/resources/qml/delegates/MessageDelegate.qml
@@ -37,7 +37,7 @@ Item {
 			roleValue: MtxEvent.EmoteMessage
 			NoticeMessage {
 				formatted: chat.model.escapeEmoji(modelData.userName) + " " + model.data.formattedBody
-				color: timelineManager.userColor(modelData.userId, colors.window)
+				color: TimelineManager.userColor(modelData.userId, colors.window)
 			}
 		}
 		DelegateChoice {
@@ -100,31 +100,31 @@ Item {
 			// TODO: make a more complex formatter for the power levels.
 			roleValue: MtxEvent.PowerLevels
 			NoticeMessage {
-				text: timelineManager.timeline.formatPowerLevelEvent(model.data.id)
+				text: TimelineManager.timeline.formatPowerLevelEvent(model.data.id)
 			}
 		}
 		DelegateChoice {
 			roleValue: MtxEvent.RoomJoinRules
 			NoticeMessage {
-				text: timelineManager.timeline.formatJoinRuleEvent(model.data.id)
+				text: TimelineManager.timeline.formatJoinRuleEvent(model.data.id)
 			}
 		}
 		DelegateChoice {
 			roleValue: MtxEvent.RoomHistoryVisibility
 			NoticeMessage {
-				text: timelineManager.timeline.formatHistoryVisibilityEvent(model.data.id)
+				text: TimelineManager.timeline.formatHistoryVisibilityEvent(model.data.id)
 			}
 		}
 		DelegateChoice {
 			roleValue: MtxEvent.RoomGuestAccess
 			NoticeMessage {
-				text: timelineManager.timeline.formatGuestAccessEvent(model.data.id)
+				text: TimelineManager.timeline.formatGuestAccessEvent(model.data.id)
 			}
 		}
 		DelegateChoice {
 			roleValue: MtxEvent.Member
 			NoticeMessage {
-				text: timelineManager.timeline.formatMemberEvent(model.data.id);
+				text: TimelineManager.timeline.formatMemberEvent(model.data.id);
 			}
 		}
 		DelegateChoice {
diff --git a/resources/qml/delegates/PlayableMediaMessage.qml b/resources/qml/delegates/PlayableMediaMessage.qml
index 8d2fa8a8..893325b6 100644
--- a/resources/qml/delegates/PlayableMediaMessage.qml
+++ b/resources/qml/delegates/PlayableMediaMessage.qml
@@ -106,7 +106,7 @@ Rectangle {
 					anchors.fill: parent
 					onClicked: {
 						switch (button.state) {
-							case "": timelineManager.timeline.cacheMedia(model.data.id); break;
+							case "": TimelineManager.timeline.cacheMedia(model.data.id); break;
 							case "stopped":
 							media.play(); console.log("play");
 							button.state = "playing"
@@ -127,7 +127,7 @@ Rectangle {
 				}
 
 				Connections {
-					target: timelineManager.timeline
+					target: TimelineManager.timeline
 					onMediaCached: {
 						if (mxcUrl == model.data.url) {
 							media.source = "file://" + cacheUrl
diff --git a/resources/qml/delegates/Reply.qml b/resources/qml/delegates/Reply.qml
index f9fd3f11..d4fffb06 100644
--- a/resources/qml/delegates/Reply.qml
+++ b/resources/qml/delegates/Reply.qml
@@ -3,6 +3,8 @@ import QtQuick.Controls 2.3
 import QtQuick.Layouts 1.2
 import QtQuick.Window 2.2
 
+import im.nheko 1.0
+
 Item {
 	id: replyComponent
 
@@ -26,7 +28,7 @@ Item {
 		anchors.bottom: replyContainer.bottom
 		width: 4
 
-		color: timelineManager.userColor(reply.modelData.userId, colors.window)
+		color: TimelineManager.userColor(reply.modelData.userId, colors.window)
 	}
 
 	Column {
diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml
index cc2d2da0..99ff9329 100644
--- a/resources/qml/delegates/TextMessage.qml
+++ b/resources/qml/delegates/TextMessage.qml
@@ -1,10 +1,12 @@
 import ".."
 
+import im.nheko 1.0
+
 MatrixText {
 	property string formatted: model.data.formattedBody
 	text: "<style type=\"text/css\">a { color:"+colors.link+";}</style>" + formatted.replace("<pre>", "<pre style='white-space: pre-wrap'>")
 	width: parent ? parent.width : undefined
 	height: isReply ? Math.round(Math.min(timelineRoot.height / 8, implicitHeight)) : undefined
 	clip: true
-	font.pointSize: (settings.enlargeEmojiOnlyMessages && model.data.isOnlyEmoji > 0 && model.data.isOnlyEmoji < 4) ? settings.fontSize * 3 : settings.fontSize
+	font.pointSize: (Settings.enlargeEmojiOnlyMessages && model.data.isOnlyEmoji > 0 && model.data.isOnlyEmoji < 4) ? Settings.fontSize * 3 : Settings.fontSize
 }