From 9339ed74f1fb3afc2eb41fef0040c5da75382590 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 20 Dec 2014 09:12:29 +0530 Subject: [PATCH] Fix #1404234 [Icon not showing on Comments custom column](https://bugs.launchpad.net/calibre/+bug/1404234) --- src/calibre/gui2/library/delegates.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index 2d383cdb68..270fffde82 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -416,6 +416,11 @@ class CcCommentsDelegate(QStyledItemDelegate): # {{{ else option.widget.style() self.document.setHtml(option.text) style.drawPrimitive(QStyle.PE_PanelItemViewItem, option, painter, widget=option.widget) + rect = style.subElementRect(QStyle.SE_ItemViewItemDecoration, option) + ic = option.icon + if rect.isValid() and not ic.isNull(): + sz = ic.actualSize(option.decorationSize) + painter.drawPixmap(rect.topLeft(), ic.pixmap(sz)) ctx = QAbstractTextDocumentLayout.PaintContext() ctx.palette = option.palette if option.state & QStyle.State_Selected: