summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-02-22 21:35:11 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-02-22 21:37:32 +0100
commitaf9b66dd3ece30e3870acc19e3e34cc70a9eaf68 (patch)
treee8ff8e0bb16b17417213b328656bed703041c191 /resources/qml
parentFix miscalculation of padding in timeline (diff)
downloadnheko-af9b66dd3ece30e3870acc19e3e34cc70a9eaf68.tar.xz
Linkify topic in room settings and use non-deprecated MessageDialog
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/RoomSettings.qml24
1 files changed, 15 insertions, 9 deletions
diff --git a/resources/qml/RoomSettings.qml b/resources/qml/RoomSettings.qml
index b37dab76..58e34a8f 100644
--- a/resources/qml/RoomSettings.qml
+++ b/resources/qml/RoomSettings.qml
@@ -1,6 +1,6 @@
 import QtQuick 2.9
 import QtQuick.Controls 2.3
-import QtQuick.Dialogs 1.2
+import Qt.labs.platform 1.1 as Platform
 import QtQuick.Layouts 1.2
 import QtQuick.Window 2.3
 import im.nheko 1.0
@@ -110,18 +110,25 @@ ApplicationWindow {
 
         ScrollView {
             Layout.maximumHeight: 75
-            ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
             Layout.alignment: Qt.AlignHCenter
-            Layout.fillWidth: true
+            width: parent.width
 
             TextArea {
-                text: roomSettings.roomTopic
-                wrapMode: TextEdit.WordWrap
+                text: TimelineManager.escapeEmoji(roomSettings.roomTopic)
+		wrapMode: TextEdit.WordWrap
+		textFormat: TextEdit.RichText
                 readOnly: true
                 background: null
                 selectByMouse: true
                 color: colors.text
-                horizontalAlignment: TextEdit.AlignHCenter
+		horizontalAlignment: TextEdit.AlignHCenter
+
+		onLinkActivated: TimelineManager.openLink(link);
+
+    CursorShape {
+        anchors.fill: parent
+        cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
+    }
             }
 
         }
@@ -186,14 +193,13 @@ ApplicationWindow {
                 Layout.alignment: Qt.AlignRight
             }
 
-            MessageDialog {
+            Platform.MessageDialog {
                 id: confirmEncryptionDialog
 
                 title: qsTr("End-to-End Encryption")
                 text: qsTr("Encryption is currently experimental and things might break unexpectedly. <br>
                             Please take note that it can't be disabled afterwards.")
                 modality: Qt.WindowModal
-                icon: StandardIcon.Question
                 onAccepted: {
                     if (roomSettings.isEncryptionEnabled)
                         return ;
@@ -203,7 +209,7 @@ ApplicationWindow {
                 onRejected: {
                     encryptionToggle.checked = false;
                 }
-                standardButtons: Dialog.Ok | Dialog.Cancel
+                buttons: Dialog.Ok | Dialog.Cancel
             }
 
             MatrixText {