Fix download metadata button in edit metadata dialog being narrower than the other buttons

This commit is contained in:
Kovid Goyal 2015-01-03 10:40:01 +05:30
parent 2d48de8cb2
commit 80dba5bf55

View File

@ -241,6 +241,14 @@ class MetadataSingleDialogBase(ResizableDialog):
self.basic_metadata_widgets.extend([self.timestamp, self.pubdate]) self.basic_metadata_widgets.extend([self.timestamp, self.pubdate])
self.fetch_metadata_button = b = RightClickButton(self) self.fetch_metadata_button = b = RightClickButton(self)
# The following rigmarole is needed so that Qt gives the button the
# same height as the other buttons in the dialog. There is no way to
# center the text in a QToolButton with an icon, so we cant just set an
# icon
b.setIcon(QIcon(I('download-metadata.png')))
b.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
b.setMinimumHeight(b.sizeHint().height())
b.setIcon(QIcon())
b.setText(_('&Download metadata')), b.setPopupMode(b.DelayedPopup) b.setText(_('&Download metadata')), b.setPopupMode(b.DelayedPopup)
b.setToolTip(_('Download metadata for this book [%s]') % self.download_shortcut.key().toString(QKeySequence.NativeText)) b.setToolTip(_('Download metadata for this book [%s]') % self.download_shortcut.key().toString(QKeySequence.NativeText))
b.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)) b.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed))