mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
MessageView: Add ToolTip to status message
Show the user that this is a status text on hover. We need to change the status text label width to be it's implicitWidth (or the maximum width as specified before), otherwise the tooltip is wildly off-centered. Signed-off-by: Marcus Hoffmann <bubu@bubu1.eu>
This commit is contained in:
parent
6c37f219ba
commit
9c5a7c4075
1 changed files with 9 additions and 2 deletions
|
@ -379,9 +379,16 @@ Item {
|
|||
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: fontMetrics.font.pointSize * 0.8
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue