Add member list and settings buttons to spaces (#1051)

* Add member list and settings buttons to spaces

* Un-buttonify the member list button

* Properly button settings *and* members
This commit is contained in:
Loren Burkholder 2022-04-22 19:43:25 -04:00 committed by GitHub
parent c8e8546315
commit 9cf0e3ca55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 6 deletions

View File

@ -10,6 +10,8 @@ import im.nheko 1.0
TextEdit { TextEdit {
id: r id: r
property alias cursorShape: cs.cursorShape
textFormat: TextEdit.RichText textFormat: TextEdit.RichText
readOnly: true readOnly: true
focus: false focus: false
@ -28,6 +30,8 @@ TextEdit {
} }
CursorShape { CursorShape {
id: cs
anchors.fill: parent anchors.fill: parent
cursorShape: hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
} }

View File

@ -10,7 +10,7 @@ import "./emoji"
import "./ui" import "./ui"
import "./voip" import "./voip"
import Qt.labs.platform 1.1 as Platform import Qt.labs.platform 1.1 as Platform
import QtQuick 2.9 import QtQuick 2.15
import QtQuick.Controls 2.5 import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import QtQuick.Window 2.13 import QtQuick.Window 2.13
@ -173,16 +173,44 @@ Item {
enabled: false enabled: false
} }
MatrixText { RowLayout {
text: parent.roomName == "" ? qsTr("No preview available") : parent.roomName spacing: Nheko.paddingMedium
font.pixelSize: 24
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
}
MatrixText { MatrixText {
text: preview.roomName == "" ? qsTr("No preview available") : preview.roomName
font.pixelSize: 24
}
ImageButton {
image: ":/icons/icons/ui/settings.svg"
visible: !!room visible: !!room
text: qsTr("%1 member(s)").arg(room ? room.roomMemberCount : 0) hoverEnabled: true
ToolTip.visible: hovered
ToolTip.text: qsTr("Settings")
onClicked: TimelineManager.openRoomSettings(room.roomId)
}
}
RowLayout {
visible: !!room
spacing: Nheko.paddingMedium
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
MatrixText {
text: qsTr("%1 member(s)").arg(room ? room.roomMemberCount : 0)
cursorShape: Qt.PointingHandCursor
}
ImageButton {
image: ":/icons/icons/ui/people.svg"
hoverEnabled: true
ToolTip.visible: hovered
ToolTip.text: qsTr("View members of %1").arg(room.roomName)
onClicked: TimelineManager.openRoomMembers(room)
}
} }
ScrollView { ScrollView {