From e378c4d5990f76b0bb4a6494da86bdc246dd7781 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 10 Jun 2012 09:56:09 +0530 Subject: [PATCH] Fix #1011030 (Search result not highlighted in tag browser) --- src/calibre/gui2/tag_browser/view.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index edf62be7df..9331194328 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -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 @@ class TagDelegate(QStyledItemDelegate): # {{{ icon.On) painter.restore() + # }}} class TagsView(QTreeView): # {{{