From 5da7897c45f62f3fb65a31a8b243b8223d0f46a2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 25 Oct 2011 11:56:05 +0530 Subject: [PATCH] Book details panel: Show tooltip only when hovering over cover, not the rest of the book information. Fixes #876454 ([Enhancement] Turn off Balloon Help) --- src/calibre/gui2/book_details.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/calibre/gui2/book_details.py b/src/calibre/gui2/book_details.py index fc05c86531..b710b62177 100644 --- a/src/calibre/gui2/book_details.py +++ b/src/calibre/gui2/book_details.py @@ -326,6 +326,18 @@ class CoverView(QWidget): # {{{ if id_ is not None: self.cover_removed.emit(id_) + def update_tooltip(self, current_path): + try: + sz = self.pixmap.size() + except: + sz = QSize(0, 0) + self.setToolTip( + '

'+_('Double-click to open Book Details window') + + '

' + _('Path') + ': ' + current_path + + '

' + _('Cover size: %(width)d x %(height)d')%dict( + width=sz.width(), height=sz.height()) + ) + # }}} # Book Info {{{ @@ -561,16 +573,7 @@ class BookDetails(QWidget): # {{{ def update_layout(self): self._layout.do_layout(self.rect()) - try: - sz = self.cover_view.pixmap.size() - except: - sz = QSize(0, 0) - self.setToolTip( - '

'+_('Double-click to open Book Details window') + - '

' + _('Path') + ': ' + self.current_path + - '

' + _('Cover size: %(width)d x %(height)d')%dict( - width=sz.width(), height=sz.height()) - ) + self.cover_view.update_tooltip(self.current_path) def reset_info(self): self.show_data(Metadata(_('Unknown')))