diff --git a/src/ui/qml/ChatPage.qml b/src/ui/qml/ChatPage.qml index e24a3a96..4de4b6f6 100644 --- a/src/ui/qml/ChatPage.qml +++ b/src/ui/qml/ChatPage.qml @@ -44,7 +44,7 @@ FocusScope { } Label { - text: contact.nickname + text: contact.nickname.replace(/\s/gm, " ").trim().substr(0,80); textFormat: Text.PlainText font.pointSize: styleHelper.pointSize } diff --git a/src/ui/qml/ContactListDelegate.qml b/src/ui/qml/ContactListDelegate.qml index 15f7c274..0383cfca 100644 --- a/src/ui/qml/ContactListDelegate.qml +++ b/src/ui/qml/ContactListDelegate.qml @@ -36,6 +36,7 @@ Rectangle { text: model.name textFormat: Text.PlainText elide: Text.ElideRight + maximumLineCount: 1 font.pointSize: styleHelper.pointSize color: "black" opacity: model.status === ContactUser.Online ? 1 : 0.8 diff --git a/src/ui/qml/MessageDelegate.qml b/src/ui/qml/MessageDelegate.qml index d328a110..f684f0b4 100644 --- a/src/ui/qml/MessageDelegate.qml +++ b/src/ui/qml/MessageDelegate.qml @@ -22,14 +22,18 @@ Column { sourceComponent: Label { //: %1 nickname text: { - if (model.section === "offline") - return qsTr("%1 is offline").arg(contact !== null ? contact.nickname : "") + if (model.section === "offline"){ + var nick = (contact ? contact.nickname.replace(/\s/gm, ' ').trim().substr(0,80) : ""); + return qsTr("%1 is offline").arg(nick) + } + else return Qt.formatDateTime(model.timestamp, Qt.DefaultLocaleShortDate) } textFormat: Text.PlainText width: background.parent.width elide: Text.ElideRight + maximumLineCount: 1 horizontalAlignment: Qt.AlignHCenter color: palette.mid