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): # {{{