mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Possible fix for incorrect size calculation with marked icon. Fixes #1486398 [Wrong column width for book row number in marked books after deletion of a marked book](https://bugs.launchpad.net/calibre/+bug/1486398)
This commit is contained in:
parent
fee64691ea
commit
3ccbb75c06
@ -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'):
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user