Add full name/topic tooltip to room header

This commit is contained in:
miruka
2019-09-07 14:14:04 -04:00
parent 66871aefe6
commit cde0c15a68
3 changed files with 24 additions and 2 deletions

View File

@@ -11,6 +11,10 @@ ToolTip {
theme.fontSize.normal * 0.5 * 75,
)
property alias label: label
background: Rectangle {
id: background
color: theme.controls.toolTip.background
@@ -19,6 +23,7 @@ ToolTip {
}
contentItem: HLabel {
id: label
color: theme.controls.toolTip.text
text: toolTip.text
wrapMode: Text.Wrap

View File

@@ -43,6 +43,8 @@ Rectangle {
viewButtons.width -
(expandButton.visible ? expandButton.width : 0)
)
HoverHandler { id: nameHover }
}
HLabel {
@@ -60,6 +62,20 @@ Rectangle {
roomName.width - viewButtons.width -
(expandButton.visible ? expandButton.width : 0)
)
HoverHandler { id: topicHover }
}
HToolTip {
text: name && topic ? (name + "<br>" + topic) : (name || topic)
label.textFormat: Text.StyledText
visible: text && (nameHover.hovered || topicHover.hovered)
readonly property string name:
roomName.truncated ?
("<b>" + chatPage.roomInfo.display_name + "</b>") : ""
readonly property string topic:
roomTopic.truncated ? chatPage.roomInfo.topic : ""
}
HSpacer {}