diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 0b1518c5b0..b563a0c6b8 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -211,6 +211,7 @@ class BooksModel(QAbstractTableModel): # {{{ # remember that the cover grid view needs a larger version of the icon, # anyway) self.marked_icon = QIcon(I('marked.png')) + self.bool_blank_icon_as_icon = QIcon(self.bool_blank_icon) self.row_decoration = None self.device_connected = False self.ids_to_highlight = [] @@ -235,7 +236,7 @@ class BooksModel(QAbstractTableModel): # {{{ self.row_height = height def set_row_decoration(self, current_marked): - self.row_decoration = self.bool_blank_icon if current_marked else None + self.row_decoration = self.bool_blank_icon_as_icon if current_marked else None def change_alignment(self, colname, alignment): if colname in self.column_map and alignment in ('left', 'right', 'center'): diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 1e2aab3543..b2146b1d91 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -55,7 +55,9 @@ class HeaderView(QHeaderView): # {{{ opt.text = unicode(model.headerData(logical_index, opt.orientation, Qt.DisplayRole) or '') if opt.orientation == Qt.Vertical: try: - opt.icon = model.headerData(logical_index, opt.orientation, Qt.DecorationRole) + val = model.headerData(logical_index, opt.orientation, Qt.DecorationRole) + if val is not None: + opt.icon = val opt.iconAlignment = Qt.AlignVCenter except (IndexError, ValueError, TypeError): pass