summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-09-20 21:26:28 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-09-20 21:26:46 +0200
commit421b15c05c605c8f4adc63433b00e37d56ac9da8 (patch)
tree47d1c7e745b07bda4fe17fe8b4348b1d08265e0e /resources/qml
parentMerge pull request #1189 from Bubu/patch-1 (diff)
downloadnheko-421b15c05c605c8f4adc63433b00e37d56ac9da8.tar.xz
Show the community of a room
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/TopBar.qml61
-rw-r--r--resources/qml/dialogs/AllowedRoomsSettingsDialog.qml1
2 files changed, 52 insertions, 10 deletions
diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml

index 2f94cf84..39365cd1 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml
@@ -49,6 +49,13 @@ Pane { return; } + if (communityLabel.visible && eventPoint.position.y < communityAvatar.height + Nheko.paddingMedium + Nheko.paddingSmall/2) { + if (!Communities.trySwitchToSpace(room.parentSpace.roomid)) + room.parentSpace.promptJoin(); + eventPoint.accepted = true + return; + } + if (room) { let p = topBar.mapToItem(roomTopicC, eventPoint.position.x, eventPoint.position.y); let link = roomTopicC.linkAt(p.x, p.y); @@ -80,11 +87,46 @@ Pane { columnSpacing: Nheko.paddingSmall rowSpacing: Nheko.paddingSmall + + Avatar { + id: communityAvatar + + visible: roomid && room.parentSpace.isLoaded && ("space:"+room.parentSpace.roomid != Communities.currentTagId) + + property string avatarUrl: (Settings.groupView && room && room.parentSpace && room.parentSpace.roomAvatarUrl) || "" + property string communityId: (Settings.groupView && room && room.parentSpace && room.parentSpace.roomid) || "" + property string communityName: (Settings.groupView && room && room.parentSpace && room.parentSpace.roomName) || "" + + Layout.column: 1 + Layout.row: 0 + Layout.alignment: Qt.AlignRight + width: fontMetrics.lineSpacing + height: fontMetrics.lineSpacing + url: avatarUrl.replace("mxc://", "image://MxcImage/") + roomid: communityId + displayName: communityName + enabled: false + } + + Label { + id: communityLabel + visible: communityAvatar.visible + + Layout.column: 2 + Layout.row: 0 + Layout.fillWidth: true + color: Nheko.colors.text + text: qsTr("In %1").arg(communityAvatar.displayName) + maximumLineCount: 1 + elide: Text.ElideRight + textFormat: Text.RichText + } + ImageButton { id: backToRoomsButton Layout.column: 0 - Layout.row: 0 + Layout.row: 1 Layout.rowSpan: 2 Layout.alignment: Qt.AlignVCenter Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium @@ -98,7 +140,7 @@ Pane { Avatar { Layout.column: 1 - Layout.row: 0 + Layout.row: 1 Layout.rowSpan: 2 Layout.alignment: Qt.AlignVCenter width: Nheko.avatarSize @@ -113,9 +155,10 @@ Pane { Label { Layout.fillWidth: true Layout.column: 2 - Layout.row: 0 + Layout.row: 1 color: Nheko.colors.text font.pointSize: fontMetrics.font.pointSize * 1.1 + font.bold: true text: roomName maximumLineCount: 1 elide: Text.ElideRight @@ -126,7 +169,7 @@ Pane { id: roomTopicC Layout.fillWidth: true Layout.column: 2 - Layout.row: 1 + Layout.row: 2 Layout.maximumHeight: fontMetrics.lineSpacing * 2 // show 2 lines selectByMouse: false enabled: false @@ -136,7 +179,7 @@ Pane { AbstractButton { Layout.column: 3 - Layout.row: 0 + Layout.row: 1 Layout.rowSpan: 2 Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium Layout.preferredWidth: Nheko.avatarSize - Nheko.paddingMedium @@ -179,7 +222,7 @@ Pane { visible: !!room && room.pinnedMessages.length > 0 Layout.column: 4 - Layout.row: 0 + Layout.row: 1 Layout.rowSpan: 2 Layout.alignment: Qt.AlignVCenter Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium @@ -207,7 +250,7 @@ Pane { visible: !!room Layout.column: 5 - Layout.row: 0 + Layout.row: 1 Layout.rowSpan: 2 Layout.alignment: Qt.AlignVCenter Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium @@ -248,7 +291,7 @@ Pane { ScrollView { id: pinnedMessages - Layout.row: 2 + Layout.row: 3 Layout.column: 2 Layout.columnSpan: 3 @@ -329,7 +372,7 @@ Pane { ScrollView { id: widgets - Layout.row: 3 + Layout.row: 4 Layout.column: 2 Layout.columnSpan: 1 diff --git a/resources/qml/dialogs/AllowedRoomsSettingsDialog.qml b/resources/qml/dialogs/AllowedRoomsSettingsDialog.qml
index 60ac06de..80905039 100644 --- a/resources/qml/dialogs/AllowedRoomsSettingsDialog.qml +++ b/resources/qml/dialogs/AllowedRoomsSettingsDialog.qml
@@ -122,7 +122,6 @@ ApplicationWindow { placeholderText: qsTr("Enter additional rooms not in the list yet...") - //font.pixelSize: Math.ceil(quickSwitcher.textHeight * 0.6) color: Nheko.colors.text onTextEdited: { roomCompleter.completer.searchString = text;