summary refs log tree commit diff
path: root/resources/qml/TimelineView.qml
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2021-07-08 21:15:50 -0400
committerJoseph Donofry <joedonofry@gmail.com>2021-07-08 21:15:50 -0400
commit1d204ce94c8b678442cccde87a9d8a670b30fe18 (patch)
treed8ec34fd579307dc35f33fc6780fdc923cae090e /resources/qml/TimelineView.qml
parentAdd nheko logo spinner to relevant places in UI (diff)
parentFix cmake template define issue (diff)
downloadnheko-1d204ce94c8b678442cccde87a9d8a670b30fe18.tar.xz
Merge remote-tracking branch 'origin/master' into nheko_loading_spinner
Diffstat (limited to 'resources/qml/TimelineView.qml')
-rw-r--r--resources/qml/TimelineView.qml78
1 files changed, 76 insertions, 2 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 5e5eccab..0209054d 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -11,7 +11,7 @@ import "./ui"
 import Qt.labs.platform 1.1 as Platform
 import QtGraphicalEffects 1.0
 import QtQuick 2.9
-import QtQuick.Controls 2.13
+import QtQuick.Controls 2.5
 import QtQuick.Layouts 1.3
 import QtQuick.Window 2.2
 import im.nheko 1.0
@@ -44,7 +44,8 @@ Item {
     ColumnLayout {
         id: timelineLayout
 
-        visible: room != null
+        visible: room != null && !room.isSpace
+        enabled: visible
         anchors.fill: parent
         spacing: 0
 
@@ -130,6 +131,79 @@ Item {
 
     }
 
+    ColumnLayout {
+        visible: room != null && room.isSpace
+        enabled: visible
+        anchors.fill: parent
+        anchors.margins: Nheko.paddingLarge
+        spacing: Nheko.paddingLarge
+
+        Avatar {
+            url: room ? room.roomAvatarUrl.replace("mxc://", "image://MxcImage/") : ""
+            displayName: room ? room.roomName : ""
+            height: 130
+            width: 130
+            Layout.alignment: Qt.AlignHCenter
+            enabled: false
+        }
+
+        MatrixText {
+            text: room ? room.roomName : ""
+            font.pixelSize: 24
+            Layout.alignment: Qt.AlignHCenter
+        }
+
+        MatrixText {
+            text: qsTr("%1 member(s)").arg(room ? room.roomMemberCount : 0)
+            Layout.alignment: Qt.AlignHCenter
+        }
+
+        ScrollView {
+            Layout.alignment: Qt.AlignHCenter
+            width: timelineView.width - Nheko.paddingLarge * 2
+
+            TextArea {
+                text: TimelineManager.escapeEmoji(room ? room.roomTopic : "")
+                wrapMode: TextEdit.WordWrap
+                textFormat: TextEdit.RichText
+                readOnly: true
+                background: null
+                selectByMouse: true
+                color: Nheko.colors.text
+                horizontalAlignment: TextEdit.AlignHCenter
+                onLinkActivated: Nheko.openLink(link)
+
+                CursorShape {
+                    anchors.fill: parent
+                    cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
+                }
+
+            }
+
+        }
+
+        Item {
+            Layout.fillHeight: true
+        }
+
+    }
+
+    ImageButton {
+        id: backToRoomsButton
+
+        anchors.top: parent.top
+        anchors.left: parent.left
+        anchors.margins: Nheko.paddingMedium
+        width: Nheko.avatarSize
+        height: Nheko.avatarSize
+        visible: room != null && room.isSpace && showBackButton
+        enabled: visible
+        image: ":/icons/icons/ui/angle-pointing-to-left.png"
+        ToolTip.visible: hovered
+        ToolTip.text: qsTr("Back to room list")
+        onClicked: Rooms.resetCurrentRoom()
+    }
+
     NhekoDropArea {
         anchors.fill: parent
         roomid: room ? room.roomId() : ""