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
@ -379,9 +379,16 @@ Item {
|
|||||||
text: Presence.userStatus(userId)
|
text: Presence.userStatus(userId)
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
width: userInfo.remainingWidth - userName_.width - parent.spacing
|
width: Math.min(implicitWidth, userInfo.remainingWidth - userName_.width - parent.spacing)
|
||||||
font.italic: true
|
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 {
|
Connections {
|
||||||
target: Presence
|
target: Presence
|
||||||
|
Loading…
Reference in New Issue
Block a user