mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Show cover size in tooltips
This commit is contained in:
parent
c3811309b0
commit
c2ece9e2fd
@ -483,8 +483,15 @@ class BookDetails(QWidget): # {{{
|
||||
self.book_info.show_data(data)
|
||||
self.cover_view.show_data(data)
|
||||
self._layout.do_layout(self.rect())
|
||||
self.setToolTip('<p>'+_('Double-click to open Book Details window') +
|
||||
'<br><br>' + _('Path') + ': ' + data.get(_('Path'), ''))
|
||||
try:
|
||||
sz = self.cover_view.pixmap.size()
|
||||
except:
|
||||
sz = QSize(0, 0)
|
||||
self.setToolTip(
|
||||
'<p>'+_('Double-click to open Book Details window') +
|
||||
'<br><br>' + _('Path') + ': ' + data.get(_('Path'), '') +
|
||||
'<br><br>' + _('Cover size: %dx%d')%(sz.width(), sz.height())
|
||||
)
|
||||
|
||||
def reset_info(self):
|
||||
self.show_data({})
|
||||
|
@ -109,6 +109,8 @@ class BookInfo(QDialog, Ui_BookInfo):
|
||||
pixmap = pixmap.scaled(new_width, new_height,
|
||||
Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
||||
self.cover.set_pixmap(pixmap)
|
||||
sz = pixmap.size()
|
||||
self.cover.setToolTip(_('Cover size: %dx%d')%(sz.width(), sz.height()))
|
||||
|
||||
def refresh(self, row):
|
||||
if isinstance(row, QModelIndex):
|
||||
|
Loading…
x
Reference in New Issue
Block a user