mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-04 21:43:35 +02:00
Fix #1011030 (Search result not highlighted in tag browser)
This commit is contained in:
parent
461f965386
commit
e378c4d599
1 changed files with 10 additions and 3 deletions
|
|
@ -25,13 +25,19 @@ class TagDelegate(QStyledItemDelegate): # {{{
|
|||
def paint(self, painter, option, index):
|
||||
item = index.data(Qt.UserRole).toPyObject()
|
||||
QStyledItemDelegate.paint(self, painter, option, index)
|
||||
widget = self.parent()
|
||||
style = QApplication.style() if widget is None else widget.style()
|
||||
self.initStyleOption(option, index)
|
||||
if item.boxed:
|
||||
r = style.subElementRect(style.SE_ItemViewItemFocusRect, option,
|
||||
widget)
|
||||
painter.save()
|
||||
painter.drawLine(r.bottomLeft(), r.bottomRight())
|
||||
painter.restore()
|
||||
if item.type != TagTreeItem.TAG:
|
||||
return
|
||||
if (item.tag.state == 0 and config['show_avg_rating'] and
|
||||
item.tag.avg_rating is not None):
|
||||
self.initStyleOption(option, index)
|
||||
widget = self.parent()
|
||||
style = QApplication.style() if widget is None else widget.style()
|
||||
r = style.subElementRect(style.SE_ItemViewItemDecoration,
|
||||
option, widget)
|
||||
icon = option.icon
|
||||
|
|
@ -48,6 +54,7 @@ def paint(self, painter, option, index):
|
|||
icon.On)
|
||||
painter.restore()
|
||||
|
||||
|
||||
# }}}
|
||||
|
||||
class TagsView(QTreeView): # {{{
|
||||
|
|
|
|||
Loading…
Reference in a new issue