mirror of https://github.com/status-im/StatusQ.git
fix(StatusChatListItem): ensure chat name elides when it's too long
Closes #151
This commit is contained in:
parent
141872c2a5
commit
34df0f0dab
|
@ -714,6 +714,15 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
|||
color: "Orange"
|
||||
unreadMessagesCount: 0
|
||||
}
|
||||
ListElement {
|
||||
chatId: "5"
|
||||
name: "channel-with-a-super-duper-long-name"
|
||||
chatType: StatusChatListItem.Type.PublicChat
|
||||
muted: false
|
||||
hasUnreadMessages: false
|
||||
color: "green"
|
||||
unreadMessagesCount: 0
|
||||
}
|
||||
}
|
||||
|
||||
ListModel {
|
||||
|
|
|
@ -143,12 +143,16 @@ Rectangle {
|
|||
id: chatName
|
||||
anchors.left: statusIcon.visible ? statusIcon.right : identicon.right
|
||||
anchors.leftMargin: statusIcon.visible ? 1 : 8
|
||||
anchors.right: statusBadge.visible ? statusBadge.left :
|
||||
mutedIcon.visible ? mutedIcon.left : parent.right
|
||||
anchors.rightMargin: 6
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
text: statusChatListItem.type === StatusChatListItem.Type.PublicChat &&
|
||||
!statusChatListItem.name.startsWith("#") ?
|
||||
"#" + statusChatListItem.name :
|
||||
statusChatListItem.name
|
||||
elide: Text.ElideRight
|
||||
color: {
|
||||
if (statusChatListItem.muted && !sensor.containsMouse && !statusChatListItem.highlighted) {
|
||||
return Theme.palette.directColor5
|
||||
|
|
Loading…
Reference in New Issue