Cleanup name handling in RoomListModel
Replace NameRole with DisplayNameRole entirely.
This commit is contained in:
@@ -20,7 +20,7 @@ QQC2.ItemDelegate {
|
||||
required property bool categoryVisible
|
||||
required property string filterText
|
||||
required property string avatar
|
||||
required property string name
|
||||
required property string displayName
|
||||
|
||||
topPadding: Kirigami.Units.largeSpacing
|
||||
leftPadding: Kirigami.Units.largeSpacing
|
||||
@@ -34,7 +34,7 @@ QQC2.ItemDelegate {
|
||||
|
||||
contentItem: Kirigami.Avatar {
|
||||
source: root.avatar ? `image://mxc/${root.avatar}` : ""
|
||||
name: root.name || i18n("No Name")
|
||||
name: root.displayName
|
||||
|
||||
sourceSize {
|
||||
width: Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2
|
||||
@@ -48,6 +48,6 @@ QQC2.ItemDelegate {
|
||||
Keys.onReturnPressed: RoomManager.enterRoom(root.currentRoom)
|
||||
|
||||
QQC2.ToolTip.visible: text.length > 0 && hovered
|
||||
QQC2.ToolTip.text: root.name ?? ""
|
||||
QQC2.ToolTip.text: root.displayName ?? ""
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ Kirigami.BasicListItem {
|
||||
required property string avatar
|
||||
required property string subtitleText
|
||||
|
||||
required property string name
|
||||
required property string displayName
|
||||
|
||||
readonly property bool hasNotifications: notificationCount > 0
|
||||
|
||||
@@ -38,7 +38,7 @@ Kirigami.BasicListItem {
|
||||
icon: undefined
|
||||
bold: root.hasNotifications
|
||||
|
||||
label: root.name ?? ""
|
||||
label: root.displayName
|
||||
labelItem.textFormat: Text.PlainText
|
||||
|
||||
subtitle: root.subtitleText
|
||||
@@ -61,7 +61,7 @@ Kirigami.BasicListItem {
|
||||
|
||||
leading: Kirigami.Avatar {
|
||||
source: root.avatar ? `image://mxc/${root.avatar}` : ""
|
||||
name: root.name || i18n("No Name")
|
||||
name: root.displayName
|
||||
implicitWidth: visible ? height : 0
|
||||
visible: Config.showAvatarInRoomDrawer
|
||||
sourceSize {
|
||||
|
||||
@@ -81,9 +81,9 @@ QQC2.Control {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: width
|
||||
display: Kirigami.NavigationTabButton.IconOnly
|
||||
text: model.name
|
||||
text: model.displayName
|
||||
source: model.avatar ? ("image://mxc/" + model.avatar) : ""
|
||||
name: model.name
|
||||
name: model.displayName
|
||||
onClicked: root.selectedSpaceId = model.id
|
||||
QQC2.ToolTip.visible: hovered
|
||||
QQC2.ToolTip.text: text
|
||||
|
||||
Reference in New Issue
Block a user