summary refs log tree commit diff
path: root/resources/qml/delegates
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-05-13 08:23:56 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-05-13 08:23:56 +0200
commita7f8b23b524c5e3af72e42fde118706e94a454f3 (patch)
treec3918f64578ee97b89dba41ae169baea09a061e6 /resources/qml/delegates
parentFix warning on gcc11 (diff)
downloadnheko-a7f8b23b524c5e3af72e42fde118706e94a454f3.tar.xz
Make palette global in Qml
Diffstat (limited to 'resources/qml/delegates')
-rw-r--r--resources/qml/delegates/FileMessage.qml8
-rw-r--r--resources/qml/delegates/ImageMessage.qml6
-rw-r--r--resources/qml/delegates/MessageDelegate.qml2
-rw-r--r--resources/qml/delegates/NoticeMessage.qml4
-rw-r--r--resources/qml/delegates/Pill.qml4
-rw-r--r--resources/qml/delegates/Placeholder.qml3
-rw-r--r--resources/qml/delegates/PlayableMediaMessage.qml14
-rw-r--r--resources/qml/delegates/Reply.qml2
-rw-r--r--resources/qml/delegates/TextMessage.qml2
9 files changed, 24 insertions, 21 deletions
diff --git a/resources/qml/delegates/FileMessage.qml b/resources/qml/delegates/FileMessage.qml
index e883ddbb..2e5f33c2 100644
--- a/resources/qml/delegates/FileMessage.qml
+++ b/resources/qml/delegates/FileMessage.qml
@@ -20,7 +20,7 @@ Item {
         Rectangle {
             id: button
 
-            color: colors.light
+            color: Nheko.colors.light
             radius: 22
             height: 44
             width: 44
@@ -55,7 +55,7 @@ Item {
                 text: model.data.filename
                 textFormat: Text.PlainText
                 elide: Text.ElideRight
-                color: colors.text
+                color: Nheko.colors.text
             }
 
             Text {
@@ -65,7 +65,7 @@ Item {
                 text: model.data.filesize
                 textFormat: Text.PlainText
                 elide: Text.ElideRight
-                color: colors.text
+                color: Nheko.colors.text
             }
 
         }
@@ -73,7 +73,7 @@ Item {
     }
 
     Rectangle {
-        color: colors.alternateBase
+        color: Nheko.colors.alternateBase
         z: -1
         radius: 10
         height: row.height + 24
diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml
index 8fcf3f82..704af3fe 100644
--- a/resources/qml/delegates/ImageMessage.qml
+++ b/resources/qml/delegates/ImageMessage.qml
@@ -19,7 +19,7 @@ Item {
 
         anchors.fill: parent
         visible: img.status != Image.Ready
-        source: model.data.blurhash ? ("image://blurhash/" + model.data.blurhash) : ("image://colorimage/:/icons/icons/ui/do-not-disturb-rounded-sign@2x.png?" + colors.buttonText)
+        source: model.data.blurhash ? ("image://blurhash/" + model.data.blurhash) : ("image://colorimage/:/icons/icons/ui/do-not-disturb-rounded-sign@2x.png?" + Nheko.colors.buttonText)
         asynchronous: true
         fillMode: Image.PreserveAspectFit
         sourceSize.width: parent.width
@@ -61,7 +61,7 @@ Item {
                 width: parent.width
                 implicitHeight: imgcaption.implicitHeight
                 anchors.bottom: overlay.bottom
-                color: colors.window
+                color: Nheko.colors.window
                 opacity: 0.75
             }
 
@@ -74,7 +74,7 @@ Item {
                 verticalAlignment: Text.AlignVCenter
                 // See this MSC: https://github.com/matrix-org/matrix-doc/pull/2530
                 text: model.data.filename ? model.data.filename : model.data.body
-                color: colors.text
+                color: Nheko.colors.text
             }
 
         }
diff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml
index d278a586..4e6a73fe 100644
--- a/resources/qml/delegates/MessageDelegate.qml
+++ b/resources/qml/delegates/MessageDelegate.qml
@@ -58,7 +58,7 @@ Item {
 
             NoticeMessage {
                 formatted: TimelineManager.escapeEmoji(modelData.userName) + " " + model.data.formattedBody
-                color: TimelineManager.userColor(modelData.userId, colors.window)
+                color: TimelineManager.userColor(modelData.userId, Nheko.colors.window)
             }
 
         }
diff --git a/resources/qml/delegates/NoticeMessage.qml b/resources/qml/delegates/NoticeMessage.qml
index 4f8fbfd2..2af41bb2 100644
--- a/resources/qml/delegates/NoticeMessage.qml
+++ b/resources/qml/delegates/NoticeMessage.qml
@@ -2,7 +2,9 @@
 //
 // SPDX-License-Identifier: GPL-3.0-or-later
 
+import im.nheko 1.0
+
 TextMessage {
     font.italic: true
-    color: colors.buttonText
+    color: Nheko.colors.buttonText
 }
diff --git a/resources/qml/delegates/Pill.qml b/resources/qml/delegates/Pill.qml
index a3fa0d9e..fef226a7 100644
--- a/resources/qml/delegates/Pill.qml
+++ b/resources/qml/delegates/Pill.qml
@@ -6,14 +6,14 @@ import QtQuick 2.5
 import QtQuick.Controls 2.1
 
 Label {
-    color: colors.brightText
+    color: Nheko.colors.brightText
     horizontalAlignment: Text.AlignHCenter
     height: contentHeight * 1.2
     width: contentWidth * 1.2
 
     background: Rectangle {
         radius: parent.height / 2
-        color: colors.alternateBase
+        color: Nheko.colors.alternateBase
     }
 
 }
diff --git a/resources/qml/delegates/Placeholder.qml b/resources/qml/delegates/Placeholder.qml
index addbc7e7..c4fc6cc3 100644
--- a/resources/qml/delegates/Placeholder.qml
+++ b/resources/qml/delegates/Placeholder.qml
@@ -3,9 +3,10 @@
 // SPDX-License-Identifier: GPL-3.0-or-later
 
 import ".."
+import im.nheko 1.0
 
 MatrixText {
     text: qsTr("unimplemented event: ") + model.data.typeString
     width: parent ? parent.width : undefined
-    color: inactiveColors.text
+    color: Nheko.inactiveColors.text
 }
diff --git a/resources/qml/delegates/PlayableMediaMessage.qml b/resources/qml/delegates/PlayableMediaMessage.qml
index b62c90df..223c2a34 100644
--- a/resources/qml/delegates/PlayableMediaMessage.qml
+++ b/resources/qml/delegates/PlayableMediaMessage.qml
@@ -13,7 +13,7 @@ Rectangle {
     id: bg
 
     radius: 10
-    color: colors.alternateBase
+    color: Nheko.colors.alternateBase
     height: Math.round(content.height + 24)
     width: parent ? parent.width : undefined
 
@@ -58,7 +58,7 @@ Rectangle {
                 id: positionText
 
                 text: "--:--:--"
-                color: colors.text
+                color: Nheko.colors.text
             }
 
             Slider {
@@ -92,14 +92,14 @@ Rectangle {
                 to: media.duration
                 onMoved: media.seek(value)
                 onValueChanged: updatePositionTexts()
-                palette: colors
+                palette: Nheko.colors
             }
 
             Text {
                 id: durationText
 
                 text: "--:--:--"
-                color: colors.text
+                color: Nheko.colors.text
             }
 
         }
@@ -112,7 +112,7 @@ Rectangle {
                 id: button
 
                 Layout.alignment: Qt.AlignVCenter
-                //color: colors.window
+                //color: Nheko.colors.window
                 //radius: 22
                 height: 32
                 width: 32
@@ -194,7 +194,7 @@ Rectangle {
                     Layout.fillWidth: true
                     text: model.data.body
                     elide: Text.ElideRight
-                    color: colors.text
+                    color: Nheko.colors.text
                 }
 
                 Text {
@@ -202,7 +202,7 @@ Rectangle {
                     text: model.data.filesize
                     textFormat: Text.PlainText
                     elide: Text.ElideRight
-                    color: colors.text
+                    color: Nheko.colors.text
                 }
 
             }
diff --git a/resources/qml/delegates/Reply.qml b/resources/qml/delegates/Reply.qml
index 603d0cf6..b8c33539 100644
--- a/resources/qml/delegates/Reply.qml
+++ b/resources/qml/delegates/Reply.qml
@@ -33,7 +33,7 @@ Item {
         anchors.top: replyContainer.top
         anchors.bottom: replyContainer.bottom
         width: 4
-        color: TimelineManager.userColor(reply.modelData.userId, colors.window)
+        color: TimelineManager.userColor(reply.modelData.userId, Nheko.colors.window)
     }
 
     Column {
diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml
index f44165b4..810ee3d4 100644
--- a/resources/qml/delegates/TextMessage.qml
+++ b/resources/qml/delegates/TextMessage.qml
@@ -9,7 +9,7 @@ MatrixText {
     property string formatted: model.data.formattedBody
     property string copyText: selectedText ? getText(selectionStart, selectionEnd) : model.data.body
 
-    text: "<style type=\"text/css\">a { color:" + colors.link + ";}\ncode { background-color: " + colors.alternateBase + ";}</style>" + formatted.replace("<pre>", "<pre style='white-space: pre-wrap; background-color: " + colors.alternateBase + "'>")
+    text: "<style type=\"text/css\">a { color:" + Nheko.colors.link + ";}\ncode { background-color: " + Nheko.colors.alternateBase + ";}</style>" + formatted.replace("<pre>", "<pre style='white-space: pre-wrap; background-color: " + Nheko.colors.alternateBase + "'>")
     width: parent ? parent.width : undefined
     height: isReply ? Math.round(Math.min(timelineRoot.height / 8, implicitHeight)) : undefined
     clip: isReply