Fix avatar loading in multiple places and prefers name instead of
display name for avatar fallback. This also fixes a bug where users didn't get their avatar loaded in the room list. Fix #209
This commit is contained in:
@@ -95,7 +95,7 @@ ToolBar {
|
||||
Layout.preferredHeight: Kirigami.Units.gridUnit
|
||||
|
||||
source: replyUser ? ("image://mxc/" + replyUser.avatarMediaId) : ""
|
||||
name: replyUser ? replyUser.displayName : i18n("No name")
|
||||
name: replyUser ? replyUser.name : i18n("No name")
|
||||
}
|
||||
|
||||
Label {
|
||||
|
||||
@@ -51,7 +51,7 @@ RowLayout {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
|
||||
visible: showAuthor && Config.showAvatarInTimeline
|
||||
name: author.displayName
|
||||
name: author.name
|
||||
source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : ""
|
||||
color: author.color
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ QQC2.AbstractButton {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
visible: Config.showAvatarInTimeline
|
||||
source: replyVisible && reply.author.avatarMediaId ? ("image://mxc/" + reply.author.avatarMediaId) : ""
|
||||
name: replyVisible ? reply.author.displayName : "H"
|
||||
name: replyVisible ? reply.author.name : "H"
|
||||
color: replyVisible ? reply.author.color : Kirigami.Theme.highlightColor
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ RowLayout {
|
||||
Layout.preferredWidth: Kirigami.Units.iconSizes.small
|
||||
Layout.preferredHeight: Kirigami.Units.iconSizes.small
|
||||
|
||||
name: author.displayName
|
||||
name: author.name
|
||||
source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : ""
|
||||
color: author.color
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Kirigami.OverlaySheet {
|
||||
Layout.preferredHeight: 72
|
||||
Layout.alignment: Qt.AlignTop
|
||||
|
||||
name: room.displayName
|
||||
name: room.name
|
||||
source: room.avatarMediaId ? ("image://mxc/" + room.avatarMediaId) : ""
|
||||
|
||||
MouseArea {
|
||||
|
||||
@@ -92,7 +92,7 @@ Kirigami.ScrollablePage {
|
||||
id: roomListItem
|
||||
property bool itemVisible: model.categoryVisible || sortFilterRoomListModel.filterText.length > 0 || Config.mergeRoomList
|
||||
visible: itemVisible
|
||||
highlighted: roomManager.currentRoom && roomManager.currentRoom.name === name
|
||||
highlighted: roomManager.currentRoom && roomManager.currentRoom.displayName === displayName
|
||||
focus: true
|
||||
action: Kirigami.Action {
|
||||
id: enterRoomAction
|
||||
@@ -151,7 +151,7 @@ Kirigami.ScrollablePage {
|
||||
QQC2.Label {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
text: name ?? ""
|
||||
text: displayName ?? ""
|
||||
elide: Text.ElideRight
|
||||
font.bold: unreadCount >= 0 || highlightCount > 0 || notificationCount > 0
|
||||
wrapMode: Text.NoWrap
|
||||
|
||||
@@ -104,7 +104,7 @@ Kirigami.OverlayDrawer {
|
||||
Layout.preferredWidth: Kirigami.Units.gridUnit * 3.5
|
||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 3.5
|
||||
|
||||
name: room ? room.displayName : i18n("No name")
|
||||
name: room ? room.name : i18n("No name")
|
||||
source: room ? ("image://mxc/" + room.avatarMediaId) : ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user