mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-10-21 14:00:29 -04:00
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().
This commit is contained in:
parent
6070c56c0f
commit
18a19e0d93
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user