Fix newlines in status messages

This commit is contained in:
Nicolas Werner 2023-02-21 23:35:52 +01:00
parent 5d7deca0db
commit 1a6728fe47
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -376,7 +376,7 @@ Item {
id: statusMsg
anchors.baseline: userNameButton.baseline
color: Nheko.colors.buttonText
text: Presence.userStatus(userId)
text: userStatus.replace(/\n/g, " ")
textFormat: Text.PlainText
elide: Text.ElideRight
width: Math.min(implicitWidth, userInfo.remainingWidth - userName_.width - parent.spacing)
@ -390,11 +390,11 @@ Item {
id: statusMsgHoverHandler
}
property string userStatus: Presence.userStatus(userId)
Connections {
target: Presence
function onPresenceChanged(id) {
if (id == userId) statusMsg.text = Presence.userStatus(userId);
if (id == userId) statusMsg.userStatus = Presence.userStatus(userId);
}
}
}