diff --git a/src/calibre/gui2/metadata/single.py b/src/calibre/gui2/metadata/single.py index 895c6b7af3..3ca543cd89 100644 --- a/src/calibre/gui2/metadata/single.py +++ b/src/calibre/gui2/metadata/single.py @@ -27,7 +27,6 @@ from calibre.utils.config import tweaks from calibre.ebooks.metadata.book.base import Metadata from calibre.utils.localization import canonicalize_lang from calibre.utils.date import local_tz -from calibre.constants import iswindows, isosx BASE_TITLE = _('Edit Metadata') @@ -101,19 +100,6 @@ class MetadataSingleDialogBase(ResizableDialog): geom = gprefs.get('metasingle_window_geometry3', None) if geom is not None: self.restoreGeometry(bytes(geom)) - self.title.resizeEvent = self.fix_push_buttons - - def fix_push_buttons(self, *args): - # Ensure all PushButtons stay the same consistent height throughout this - # dialog. Without this, the buttons inside scrollareas get shrunk, - # while the buttons outside them do not, leading to weirdness. - # Further, buttons with and without icons have different minimum sizes - # so things look even more out of whack. - ht = self.next_button.height() if iswindows or isosx else self.title.height() + 1 - for but in self.findChildren(QPushButton): - but.setMaximumHeight(ht) - but.setMinimumHeight(ht) - return TitleEdit.resizeEvent(self.title, *args) # }}} def create_basic_metadata_widgets(self): # {{{ diff --git a/src/qtcurve/style/qtcurve.cpp b/src/qtcurve/style/qtcurve.cpp index 2d186c63e7..2dcc2737ba 100644 --- a/src/qtcurve/style/qtcurve.cpp +++ b/src/qtcurve/style/qtcurve.cpp @@ -9685,13 +9685,14 @@ QSize Style::sizeFromContents(ContentsType type, const QStyleOption *option, con if (const QStyleOptionButton *btn = qstyleoption_cast(option)) { + // Added by Kovid to ensure that pushbuttons without icons are never narrower than push buttons with icons at small font sizes + int min_pb_height = (btn->iconSize.height() > 16) ? btn->iconSize.height() : 16; + if (newSize.height() < min_pb_height) newSize.setHeight(min_pb_height); + if(!opts.stdBtnSizes) { - bool dialogButton= - // Cant rely on AutoDefaultButton - as VirtualBox does not set this!!! - // btn->features&QStyleOptionButton::AutoDefaultButton && - widget && widget->parentWidget() && - (::qobject_cast(widget->parentWidget()) || widget->parentWidget()->inherits("KFileWidget")); + // Changed by Kovid since we dont care about VirtualBox + bool dialogButton = btn->features&QStyleOptionButton::AutoDefaultButton; if(dialogButton) {