Merge pull request #610 from Nheko-Reborn/spaces
Show some spaces in the community sidebar
4 files changed, 81 insertions, 6 deletions
diff --git a/resources/qml/ChatPage.qml b/resources/qml/ChatPage.qml
index df2bf41f..cd323a97 100644
--- a/resources/qml/ChatPage.qml
+++ b/resources/qml/ChatPage.qml
@@ -71,7 +71,7 @@ Rectangle {
AdaptiveLayoutElement {
id: timlineViewC
- minimumWidth: fontMetrics.averageCharacterWidth * 40 + Nheko.avatarSize + 2* Nheko.paddingMedium
+ minimumWidth: fontMetrics.averageCharacterWidth * 40 + Nheko.avatarSize + 2 * Nheko.paddingMedium
TimelineView {
id: timeline
diff --git a/resources/qml/MatrixText.qml b/resources/qml/MatrixText.qml
index 167899a5..65d66315 100644
--- a/resources/qml/MatrixText.qml
+++ b/resources/qml/MatrixText.qml
@@ -12,7 +12,8 @@ TextEdit {
focus: false
wrapMode: Text.Wrap
selectByMouse: !Settings.mobileMode
- enabled: selectByMouse
+ // this always has to be enabled, otherwise you can't click links anymore!
+ //enabled: selectByMouse
color: Nheko.colors.text
onLinkActivated: Nheko.openLink(link)
ToolTip.visible: hoveredLink
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index 5845eb81..c4a8bcfb 100644
--- a/resources/qml/RoomList.qml
+++ b/resources/qml/RoomList.qml
@@ -255,6 +255,8 @@ Page {
Label {
id: timestamp
+ visible: !model.isInvite && !model.isSpace
+ width: visible ? 0 : undefined
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
font.pixelSize: fontMetrics.font.pixelSize * 0.9
color: roomItem.unimportantText
@@ -266,12 +268,11 @@ Page {
RowLayout {
Layout.fillWidth: true
spacing: 0
- visible: !model.isInvite
+ visible: !model.isInvite && !model.isSpace
height: visible ? 0 : undefined
ElidedLabel {
color: roomItem.unimportantText
- font.weight: Font.Thin
font.pixelSize: fontMetrics.font.pixelSize * 0.9
elideWidth: textContent.width - (notificationBubble.visible ? notificationBubble.width : 0) - Nheko.paddingSmall
fullText: model.lastMessage
@@ -485,7 +486,6 @@ Page {
ElidedLabel {
Layout.alignment: Qt.AlignTop
color: Nheko.colors.buttonText
- font.weight: Font.Thin
font.pointSize: fontMetrics.font.pointSize * 0.9
elideWidth: col.width
fullText: userInfoGrid.profile ? userInfoGrid.profile.userid : ""
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 90e28166..2c7c943a 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -41,7 +41,8 @@ Item {
ColumnLayout {
id: timelineLayout
- visible: room != null
+ visible: room != null && !room.isSpace
+ enabled: visible
anchors.fill: parent
spacing: 0
@@ -127,6 +128,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() : ""
|