diff --git a/src/config/settings.py b/src/config/settings.py index 6517d05d..a8321443 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -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"] diff --git a/src/gui/Pages/Chat/Timeline/EventContent.qml b/src/gui/Pages/Chat/Timeline/EventContent.qml index b0fd0dbb..363d381e 100644 --- a/src/gui/Pages/Chat/Timeline/EventContent.qml +++ b/src/gui/Pages/Chat/Timeline/EventContent.qml @@ -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 "" diff --git a/src/gui/Pages/Chat/Timeline/EventList.qml b/src/gui/Pages/Chat/Timeline/EventList.qml index 0d5160e2..98bb3e0e 100644 --- a/src/gui/Pages/Chat/Timeline/EventList.qml +++ b/src/gui/Pages/Chat/Timeline/EventList.qml @@ -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: