summary refs log tree commit diff
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2023-02-21 23:21:57 +0100
committerGitHub <noreply@github.com>2023-02-21 23:21:57 +0100
commit5301f98d4a4ab16607774f6bd1914706e65be36e (patch)
treeb187a5f7714b5658ea9be5e9d9af66691d01db89
parentSwitch to upstream olm error code (diff)
parentUserProfile: add padding to device list (diff)
downloadnheko-5301f98d4a4ab16607774f6bd1914706e65be36e.tar.xz
Merge pull request #1379 from Bubu/style_presence_status
Status Message Improvements
-rw-r--r--resources/qml/MessageView.qml12
-rw-r--r--resources/qml/dialogs/UserProfile.qml26
2 files changed, 36 insertions, 2 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml

index 7f39791f..573c8344 100644 --- a/resources/qml/MessageView.qml +++ b/resources/qml/MessageView.qml
@@ -348,6 +348,7 @@ Item { } property int remainingWidth: chat.delegateMaxWidth - spacing - messageUserAvatar.width AbstractButton { + id: userNameButton contentItem: ElidedLabel { id: userName_ fullText: userName @@ -373,12 +374,21 @@ Item { Label { id: statusMsg + anchors.baseline: userNameButton.baseline color: Nheko.colors.buttonText text: Presence.userStatus(userId) textFormat: Text.PlainText elide: Text.ElideRight - width: userInfo.remainingWidth - userName_.width - parent.spacing + width: Math.min(implicitWidth, userInfo.remainingWidth - userName_.width - parent.spacing) font.italic: true + font.pointSize: Math.floor(fontMetrics.font.pointSize * 0.8) + ToolTip.text: qsTr("%1's status message").arg(userName) + ToolTip.visible: statusMsgHoverHandler.hovered + ToolTip.delay: Nheko.tooltipDelay + + HoverHandler { + id: statusMsgHoverHandler + } Connections { target: Presence diff --git a/resources/qml/dialogs/UserProfile.qml b/resources/qml/dialogs/UserProfile.qml
index 684ada8f..75852245 100644 --- a/resources/qml/dialogs/UserProfile.qml +++ b/resources/qml/dialogs/UserProfile.qml
@@ -56,7 +56,7 @@ ApplicationWindow { id: contentL width: devicelist.width - spacing: 10 + spacing: Nheko.paddingMedium Avatar { id: displayAvatar @@ -177,6 +177,28 @@ ApplicationWindow { Layout.alignment: Qt.AlignHCenter } + MatrixText { + id: statusMsg + text: updateStatus() + visible: Presence.userStatus(profile.userid) != "" + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + horizontalAlignment: TextEdit.AlignHCenter + Layout.leftMargin: Nheko.paddingMedium + Layout.rightMargin: Nheko.paddingMedium + font.pointSize: Math.floor(fontMetrics.font.pointSize * 0.9) + + function updateStatus(){ + return qsTr("<i><b>Status:</b> %1</i>").arg(Presence.userStatus(profile.userid)) + } + Connections { + target: Presence + function onPresenceChanged(id) { + if (id == profile.userid) statusMsg.text = statusMsg.updateStatus(); + } + } + } + RowLayout { visible: !profile.isGlobalUserProfile Layout.alignment: Qt.AlignHCenter @@ -295,6 +317,8 @@ ApplicationWindow { ColumnLayout { spacing: 0 + Layout.leftMargin: Nheko.paddingMedium + Layout.rightMargin: Nheko.paddingMedium RowLayout { Text { Layout.fillWidth: true