From 0146da93f550c49bcdf36f9ec5ee76b09a77a1ca Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 20 Nov 2025 12:07:03 +0530 Subject: [PATCH] E-book viewer: Highlights panel: Show the date for highlights in the tooltip when hovering over a highlight. Fixes #2131619 [Viewer - annotations timestamps](https://bugs.launchpad.net/calibre/+bug/2131619) --- src/calibre/gui2/viewer/highlights.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/highlights.py b/src/calibre/gui2/viewer/highlights.py index 08065505a7..f26e84426b 100644 --- a/src/calibre/gui2/viewer/highlights.py +++ b/src/calibre/gui2/viewer/highlights.py @@ -49,7 +49,7 @@ from calibre.ebooks.epub.cfi.parse import cfi_sort_key from calibre.gui2 import error_dialog, is_dark_theme, safe_open_url from calibre.gui2.dialogs.confirm_delete import confirm from calibre.gui2.gestures import GestureManager -from calibre.gui2.library.annotations import ChapterGroup, Details, render_notes +from calibre.gui2.library.annotations import ChapterGroup, Details, render_notes, render_timestamp from calibre.gui2.library.annotations import Export as ExportBase from calibre.gui2.viewer import get_boss, link_prefix_for_location_links from calibre.gui2.viewer.config import get_session_pref, vprefs @@ -453,6 +453,8 @@ class Highlights(QTreeWidget): if dec is None: dec = self.default_decoration item.setData(0, Qt.ItemDataRole.DecorationRole, dec) + if ts := h.get('timestamp'): + item.setData(0, Qt.ItemDataRole.ToolTipRole, render_timestamp(ts)) self.uuid_map[h['uuid']] = secnum, itemnum self.num_of_items += 1 self.apply_filters()