mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Tag Browser: Show the category key in the tooltip for all categories
This commit is contained in:
commit
6ac59c747b
@ -374,7 +374,13 @@ class TagTreeItem(object): # {{{
|
|||||||
elif self.type == self.TAG:
|
elif self.type == self.TAG:
|
||||||
icon_map[0] = data.icon
|
icon_map[0] = data.icon
|
||||||
self.tag, self.icon_state_map = data, list(map(QVariant, icon_map))
|
self.tag, self.icon_state_map = data, list(map(QVariant, icon_map))
|
||||||
self.tooltip = tooltip
|
if tooltip:
|
||||||
|
if tooltip.endswith(':'):
|
||||||
|
self.tooltip = tooltip + ' '
|
||||||
|
else:
|
||||||
|
self.tooltip = tooltip + ': '
|
||||||
|
else:
|
||||||
|
self.tooltip = ''
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.type == self.ROOT:
|
if self.type == self.ROOT:
|
||||||
@ -436,8 +442,10 @@ class TagTreeItem(object): # {{{
|
|||||||
return QVariant('(%s) %s'%(tag.name, tag.tooltip))
|
return QVariant('(%s) %s'%(tag.name, tag.tooltip))
|
||||||
else:
|
else:
|
||||||
return QVariant(tag.name)
|
return QVariant(tag.name)
|
||||||
if tag.tooltip is not None:
|
if tag.tooltip:
|
||||||
return QVariant(tag.tooltip)
|
return QVariant(self.tooltip + tag.tooltip)
|
||||||
|
else:
|
||||||
|
return QVariant(self.tooltip)
|
||||||
return NONE
|
return NONE
|
||||||
|
|
||||||
def toggle(self):
|
def toggle(self):
|
||||||
@ -736,10 +744,11 @@ class TagsModel(QAbstractItemModel): # {{{
|
|||||||
category_icon = category_node.icon,
|
category_icon = category_node.icon,
|
||||||
tooltip = None,
|
tooltip = None,
|
||||||
category_key=category_node.category_key)
|
category_key=category_node.category_key)
|
||||||
t = TagTreeItem(parent=sub_cat, data=tag,
|
t = TagTreeItem(parent=sub_cat, data=tag, tooltip=r,
|
||||||
icon_map=self.icon_state_map)
|
icon_map=self.icon_state_map)
|
||||||
else:
|
else:
|
||||||
t = TagTreeItem(parent=category, data=tag, icon_map=self.icon_state_map)
|
t = TagTreeItem(parent=category, data=tag, tooltip=r,
|
||||||
|
icon_map=self.icon_state_map)
|
||||||
self.endInsertRows()
|
self.endInsertRows()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -1243,7 +1243,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
else:
|
else:
|
||||||
icon = icon_map[':custom']
|
icon = icon_map[':custom']
|
||||||
icon_map[category] = icon
|
icon_map[category] = icon
|
||||||
tooltip = self.custom_column_label_map[label]['name']
|
|
||||||
|
|
||||||
datatype = cat['datatype']
|
datatype = cat['datatype']
|
||||||
avgr = lambda x: 0.0 if x.rc == 0 else x.rt/x.rc
|
avgr = lambda x: 0.0 if x.rc == 0 else x.rt/x.rc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user