mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-18 19:23:13 +02:00
port the new tb tooltip to the new backend
This commit is contained in:
parent
08fc8e274a
commit
aa256bb189
2 changed files with 3 additions and 5 deletions
|
|
@ -35,6 +35,8 @@ def __init__(self, name, id=None, count=0, state=0, avg=0, sort=None,
|
|||
self.avg_rating = avg/2.0 if avg is not None else 0
|
||||
self.sort = sort
|
||||
self.use_sort_as_name = use_sort_as_name
|
||||
if tooltip is None:
|
||||
tooltip = '(%s:%s)'%(category, name)
|
||||
if self.avg_rating > 0:
|
||||
if tooltip:
|
||||
tooltip = tooltip + ': '
|
||||
|
|
@ -65,7 +67,6 @@ def find_categories(field_metadata):
|
|||
def create_tag_class(category, fm, icon_map):
|
||||
cat = fm[category]
|
||||
icon = None
|
||||
tooltip = None if category in {'formats', 'identifiers'} else ('(' + category + ')')
|
||||
label = fm.key_to_label(category)
|
||||
if icon_map:
|
||||
if not fm.is_custom_field(category):
|
||||
|
|
@ -87,8 +88,7 @@ def create_tag_class(category, fm, icon_map):
|
|||
use_sort_as_name = False
|
||||
|
||||
return partial(Tag, use_sort_as_name=use_sort_as_name, icon=icon,
|
||||
tooltip=tooltip, is_editable=is_editable,
|
||||
category=category)
|
||||
is_editable=is_editable, category=category)
|
||||
|
||||
def clean_user_categories(dbcache):
|
||||
user_cats = dbcache.pref('user_categories', {})
|
||||
|
|
|
|||
|
|
@ -1934,8 +1934,6 @@ def get_categories(self, sort='name', ids=None, icon_map=None):
|
|||
is_editable = category not in ['news', 'rating', 'languages']
|
||||
categories[category] = [tag_class(formatter(r.n), count=r.c, id=r.id,
|
||||
avg=avgr(r), sort=r.s, icon=icon,
|
||||
tooltip=u'({0}:{1})'.format(category,
|
||||
formatter(r.n)),
|
||||
category=category,
|
||||
id_set=r.id_set, is_editable=is_editable,
|
||||
use_sort_as_name=use_sort_as_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue