mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make leaf nodes in tag browser have custom icons
This commit is contained in:
parent
b395338d5d
commit
7dd6fbd80e
@ -514,6 +514,7 @@ class TagsModel(QAbstractItemModel): # {{{
|
|||||||
if (not tag.is_hierarchical) and (in_uc or
|
if (not tag.is_hierarchical) and (in_uc or
|
||||||
(fm['is_custom'] and fm['display'].get('is_names', False)) or
|
(fm['is_custom'] and fm['display'].get('is_names', False)) or
|
||||||
not category_is_hierarchical or len(components) == 1):
|
not category_is_hierarchical or len(components) == 1):
|
||||||
|
tag.icon = self.category_custom_icons[key]
|
||||||
n = self.create_node(parent=node_parent, data=tag, tooltip=tt,
|
n = self.create_node(parent=node_parent, data=tag, tooltip=tt,
|
||||||
icon_map=self.icon_state_map)
|
icon_map=self.icon_state_map)
|
||||||
if tag.id_set is not None:
|
if tag.id_set is not None:
|
||||||
@ -550,6 +551,7 @@ class TagsModel(QAbstractItemModel): # {{{
|
|||||||
t.is_hierarchical = \
|
t.is_hierarchical = \
|
||||||
'5state' if t.category != 'search' else '3state'
|
'5state' if t.category != 'search' else '3state'
|
||||||
t.name = comp
|
t.name = comp
|
||||||
|
t.icon = self.category_custom_icons[key]
|
||||||
node_parent = self.create_node(parent=node_parent, data=t,
|
node_parent = self.create_node(parent=node_parent, data=t,
|
||||||
tooltip=tt, icon_map=self.icon_state_map)
|
tooltip=tt, icon_map=self.icon_state_map)
|
||||||
child_map[(comp,tag.category)] = node_parent
|
child_map[(comp,tag.category)] = node_parent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user