Add Keys.Messages.seen_tooltips keybind

Toggle display of the focused message's seen counter tooltip,
which shows which user have this message as their last seen
and when did they send that information.
When this mode is active, you can move the focus
to other messages  and the tooltip will update itself.
If a message doesn't have a counter, it won't have a tooltip.
This commit is contained in:
miruka 2021-01-17 12:09:59 -04:00
parent f22758ea89
commit c59d54877a
3 changed files with 26 additions and 1 deletions

View File

@ -371,6 +371,14 @@ class Keys:
# If no message is focused but some are selected, clear the selection.
unfocus_or_deselect = ["Ctrl+D"]
# Toggle display of the focused message's seen counter tooltip,
# which shows which user have this message as their last seen and when
# did they send that information.
# When this mode is active, you can move the focus to other messages
# and the tooltip will update itself.
# If a message doesn't have a counter, it won't have a tooltip.
seen_tooltips = ["Ctrl+S"]
# Remove the selected messages if any, else the focused message if any,
# else the last message you posted.
remove = ["Ctrl+R", "Alt+Del"]

View File

@ -262,7 +262,15 @@ HRowLayout {
}
HToolTip {
visible: eventContent.hoveredLink === "#state-text"
readonly property bool keyboardShow:
eventList.showFocusedSeenTooltips &&
eventList.currentIndex === model.index &&
model.read_by_count > 0
instant: keyboardShow
visible:
eventContent.hoveredLink === "#state-text" || keyboardShow
label.textFormat: HLabel.StyledText
text: {
if (! visible) return ""

View File

@ -51,6 +51,13 @@ Rectangle {
eventList.checkFromLastToHere(eventList.currentIndex)
}
HShortcut {
sequences: window.settings.Keys.Messages.seen_tooltips
onActivated:
eventList.showFocusedSeenTooltips =
! eventList.showFocusedSeenTooltips
}
HShortcut {
readonly property var events:
eventList.selectedCount ?
@ -237,6 +244,8 @@ Rectangle {
property string delegateWithSelectedText: ""
property string selectedText: ""
property bool showFocusedSeenTooltips: false
property alias cursorShape: cursorShapeArea.cursorShape
readonly property bool shouldLoadPastEvents: