From 18a19e0d93cc27dc694aad6c7c61a11f90dddc68 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sat, 6 Sep 2025 10:06:27 +0100 Subject: [PATCH] Fix problem with custom tooltips not being taken into account the first time one is defind for a column, As it is, in this situation calibre must be restarted. Having calibre always check when the tooltip is requested is fast and doesn't require inventing some refresh mechanism for build_data_converters(). --- src/calibre/gui2/library/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 331b5a5063..ab4df75713 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -1022,7 +1022,10 @@ class BooksModel(QAbstractTableModel): # {{{ tc[f] = stars_tooltip(self.dc[f], allow_half) for f in bool_fields: tc[f] = bool_tooltip(f) - for f in self.db.new_api.pref('column_tooltip_templates', {}): + # Make all columns use the template tooltip renderer. This avoids the + # "first time" problem where a template tooltip is added but not + # used until calibre is restarted + for f in self.column_map: tc[f] = template_tooltip(f, tc[f]) # build a index column to data converter map, to remove the string lookup in the data loop self.column_to_dc_map = [self.dc[col] for col in self.column_map]