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

@ -35,10 +35,10 @@
- Room header descriptions: styled text - Room header descriptions: styled text
- Message selection - Message selection
- Make scroll wheel usable
- Copy to X11 selection - Copy to X11 selection
- Link previews - Link previews
- Support images not just at the end of the message - Support showing images at the place they should be instead of always
at the end of the message
- Just use Shortcut onHeld instead of analyzing the current velocity - Just use Shortcut onHeld instead of analyzing the current velocity
in `smartVerticalFlick()` in `smartVerticalFlick()`
@ -159,6 +159,7 @@
- nio - nio
- `AsyncClient.share_group_session`: send device batches concurrently - `AsyncClient.share_group_session`: send device batches concurrently
- Guard against asyncio OSError Network unreachable
- downloads API - downloads API
- MatrixRoom invited members list - MatrixRoom invited members list

View File

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

View File

@ -43,6 +43,8 @@ Rectangle {
viewButtons.width - viewButtons.width -
(expandButton.visible ? expandButton.width : 0) (expandButton.visible ? expandButton.width : 0)
) )
HoverHandler { id: nameHover }
} }
HLabel { HLabel {
@ -60,6 +62,20 @@ Rectangle {
roomName.width - viewButtons.width - roomName.width - viewButtons.width -
(expandButton.visible ? expandButton.width : 0) (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 {} HSpacer {}