summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-10-18 22:43:45 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-10-18 22:43:45 +0200
commit78fac7dced05c8c020aa84d3e403dd72ecf76027 (patch)
treec1928873f1854bc8e903f8bc39f581c6c2a1c8bc /resources
parentRelayout when event delegates change implicit size (diff)
downloadnheko-78fac7dced05c8c020aa84d3e403dd72ecf76027.tar.xz
Small qml fixes
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/CommunitiesList.qml6
-rw-r--r--resources/qml/MatrixText.qml3
-rw-r--r--resources/qml/ReplyPopup.qml2
-rw-r--r--resources/qml/dialogs/AliasEditor.qml8
4 files changed, 8 insertions, 11 deletions
diff --git a/resources/qml/CommunitiesList.qml b/resources/qml/CommunitiesList.qml
index 81f0640e..37a44163 100644
--- a/resources/qml/CommunitiesList.qml
+++ b/resources/qml/CommunitiesList.qml
@@ -143,11 +143,11 @@ Page {
                     enabled: false
                     height: avatarSize
                     roomid: model.id
-                    textColor: model.avatarUrl.startsWith(":/") ? communityItem.unimportantText : communityItem.importantText
+                    textColor: model.avatarUrl?.startsWith(":/") == true ? communityItem.unimportantText : communityItem.importantText
                     url: {
-                        if (model.avatarUrl.startsWith("mxc://"))
+                        if (model.avatarUrl?.startsWith("mxc://") == true)
                             return model.avatarUrl.replace("mxc://", "image://MxcImage/");
-                        else if (model.avatarUrl.length > 0)
+                        else if ((model.avatarUrl?.length ?? 0) > 0)
                             return model.avatarUrl;
                         else
                             return "";
diff --git a/resources/qml/MatrixText.qml b/resources/qml/MatrixText.qml
index c804e72e..bdc0cb6b 100644
--- a/resources/qml/MatrixText.qml
+++ b/resources/qml/MatrixText.qml
@@ -2,9 +2,6 @@
 //
 // SPDX-License-Identifier: GPL-3.0-or-later
 
-// TODO: using any Qt 6 API version will screw up the reply text color. We need to
-//       figure out a more permanent fix than just importing the old version.
-//import QtQuick 2.15
 import QtQuick
 import QtQuick.Controls
 import im.nheko
diff --git a/resources/qml/ReplyPopup.qml b/resources/qml/ReplyPopup.qml
index 5657c08a..17ce7ee4 100644
--- a/resources/qml/ReplyPopup.qml
+++ b/resources/qml/ReplyPopup.qml
@@ -29,7 +29,7 @@ Rectangle {
         anchors.rightMargin: replyPopup.width < 450 ? 2 * (22 + 16) : 3 * (22 + 16)
         anchors.top: parent.top
         anchors.topMargin: Nheko.paddingSmall
-        eventId: room.reply ?? ""
+        eventId: room?.reply ?? ""
         userColor: TimelineManager.userColor(modelData.userId, palette.window)
         visible: room && room.reply
         maxWidth: parent.width - anchors.leftMargin - anchors.rightMargin
diff --git a/resources/qml/dialogs/AliasEditor.qml b/resources/qml/dialogs/AliasEditor.qml
index c49ad321..df2938ef 100644
--- a/resources/qml/dialogs/AliasEditor.qml
+++ b/resources/qml/dialogs/AliasEditor.qml
@@ -4,10 +4,10 @@
 
 import ".."
 import "../components"
-import QtQuick 2.12
-import QtQuick.Controls 2.5
-import QtQuick.Layouts 1.3
-import im.nheko 1.0
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import im.nheko
 
 
 ApplicationWindow {