Add how many rooms you have in common to the user detail dialog

Eventually this will be expanded into an actual list you can look
through, but this can at least give you an idea the
number of rooms this user shares with you. If the user doesn't share any
rooms with you (e.g. they left) then the label is hidden.
This commit is contained in:
Joshua Goins
2025-01-18 10:50:46 -05:00
parent 590fba7deb
commit c583e31b16
4 changed files with 149 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ Kirigami.Dialog {
ColumnLayout {
Layout.fillWidth: true
spacing: 0
Kirigami.Heading {
level: 1
Layout.fillWidth: true
@@ -71,6 +73,19 @@ Kirigami.Dialog {
textFormat: TextEdit.PlainText
text: root.user.id
}
QQC2.Label {
property CommonRoomsModel model: CommonRoomsModel {
connection: root.connection
userId: root.user.id
}
text: i18ncp("@info", "One mutual room", "%1 mutual rooms", model.count)
color: Kirigami.Theme.disabledTextColor
visible: model.count > 0
Layout.topMargin: Kirigami.Units.smallSpacing
}
}
QQC2.AbstractButton {
Layout.minimumHeight: avatar.height * 0.75