Reduce layout shift when loading mutual rooms in user profiles
Instead of making the visibility of this section in user profiles dependent on the model, its now checking if you can check mutual rooms and using a busy indicator. There's also a label for when you have no rooms in common, which is a rare case (for example, banned or left users.)
This commit is contained in:
@@ -401,18 +401,36 @@ Kirigami.Dialog {
|
||||
Kirigami.Heading {
|
||||
text: i18nc("@title The set of common rooms between your current user and the one shown", "Mutual Rooms")
|
||||
level: 4
|
||||
visible: !root.isSelf && root.hasMutualRooms
|
||||
visible: !root.isSelf && root.connection.canCheckMutualRooms
|
||||
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
visible: !root.isSelf && root.hasMutualRooms
|
||||
visible: !root.isSelf && root.connection.canCheckMutualRooms
|
||||
|
||||
Layout.topMargin: Kirigami.Units.smallSpacing
|
||||
|
||||
QQC2.BusyIndicator {
|
||||
visible: roomRepeater.count === 0 && root.model.loading
|
||||
|
||||
Layout.preferredWidth: Kirigami.Units.iconSizes.medium
|
||||
Layout.preferredHeight: Kirigami.Units.iconSizes.medium
|
||||
}
|
||||
|
||||
QQC2.Label {
|
||||
visible: roomRepeater.count === 0 && !root.model.loading
|
||||
text: i18nc("@info:label", "No rooms in common")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
Layout.preferredHeight: Kirigami.Units.iconSizes.medium
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Repeater {
|
||||
id: roomRepeater
|
||||
|
||||
model: root.limiterModel
|
||||
|
||||
delegate: KirigamiComponents.AvatarButton {
|
||||
|
||||
Reference in New Issue
Block a user