From 43bf3cc68dfc72ef6f1612aff081971f351db49a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 3 Jun 2012 01:15:17 +0530 Subject: [PATCH] ... --- src/calibre/gui2/__init__.py | 7 ------- src/calibre/gui2/metadata/single.py | 12 +++++++++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 55c59b3677..f55e4c571e 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -763,13 +763,6 @@ class Application(QApplication): self.setStyle('Plastique') elif 'Cleanlooks' in styles: self.setStyle('Cleanlooks') - # Ensure that pushbuttons with no icons are not narrower than - # pushbuttons with icons - from PyQt4.Qt import QPushButton - w = QPushButton() - self.setStyleSheet('QPushButton { min-height: %dpx }'% - (w.iconSize().height())) - def _send_file_open_events(self): with self._file_open_lock: diff --git a/src/calibre/gui2/metadata/single.py b/src/calibre/gui2/metadata/single.py index eb00e8365a..85d543d8ca 100644 --- a/src/calibre/gui2/metadata/single.py +++ b/src/calibre/gui2/metadata/single.py @@ -96,11 +96,21 @@ class MetadataSingleDialogBase(ResizableDialog): if len(self.db.custom_column_label_map): self.create_custom_metadata_widgets() - self.do_layout() 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. + ht = self.title.height() + for but in self.findChildren(QPushButton): + but.setMaximumHeight(ht) + but.setMinimumHeight(ht) + return TitleEdit.resizeEvent(self.title, *args) # }}} def create_basic_metadata_widgets(self): # {{{