Show authors in addition to title when cover not available

This commit is contained in:
Kovid Goyal 2013-08-05 14:13:05 +05:30
parent 0e64b0c886
commit 10b4b9d39c

View File

@ -398,7 +398,8 @@ class CoverDelegate(QStyledItemDelegate):
rect.adjust(4, 4, -4, -4) rect.adjust(4, 4, -4, -4)
if cdata is None or cdata is False: if cdata is None or cdata is False:
title = db.field_for('title', book_id, default_value='') title = db.field_for('title', book_id, default_value='')
painter.drawText(rect, Qt.AlignCenter|Qt.TextWordWrap, title) authors = ' & '.join(db.field_for('authors', book_id, default_value=()))
painter.drawText(rect, Qt.AlignCenter|Qt.TextWordWrap, '%s\n\n%s' % (title, authors))
if cdata is False: if cdata is False:
self.render_queue.put(book_id) self.render_queue.put(book_id)
else: else: