Allow advanced emblem rules to return multiple icon names using the same syntax as icon rules.

This commit is contained in:
Charles Haley 2021-04-04 10:34:03 +01:00
parent 4c928a6c30
commit 5d0289606d

View File

@ -533,9 +533,10 @@ class CoverDelegate(QStyledItemDelegate):
for i, (kind, column, rule) in enumerate(emblem_rules):
icon_name, mi = self.render_emblem(book_id, rule, i, m.cover_grid_emblem_cache, mi, db, m.formatter, m.cover_grid_template_cache)
if icon_name is not None:
pixmap = self.cached_emblem(m.cover_grid_bitmap_cache, icon_name)
if pixmap is not None:
emblems.append(pixmap)
for one_icon in [i.strip() for i in icon_name.split(':') if i.strip()]:
pixmap = self.cached_emblem(m.cover_grid_bitmap_cache, one_icon)
if pixmap is not None:
emblems.append(pixmap)
if marked:
emblems.insert(0, self.cached_emblem(m.cover_grid_bitmap_cache, ':marked', m.marked_icon))
if on_device: