From 1b1de7242b5a7559a9a59828a52c86a7de187851 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 26 Sep 2020 14:39:57 +0530 Subject: [PATCH] macOS: Fix cover trim and customize cover generation drop down menus in the edit metadata dialog not working Some behavior change in Qt 5.15 now requires the menus to have a parent set on macOS --- src/calibre/gui2/metadata/basic_widgets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index f3c12328ea..2208f2e32e 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -1113,7 +1113,7 @@ class Cover(ImageView): # {{{ b.setToolTip(_( 'Automatically detect and remove extra space at the cover\'s edges.\n' 'Pressing it repeatedly can sometimes remove stubborn borders.')) - b.m = m = QMenu() + b.m = m = QMenu(b) b.setPopupMode(QToolButton.InstantPopup) m.addAction(QIcon(I('trim.png')), _('Automatically trim borders'), self.trim_cover) m.addSeparator() @@ -1124,7 +1124,7 @@ class Cover(ImageView): # {{{ self.download_cover_button = CB(_('Download co&ver'), 'arrow-down.png', self.download_cover) self.generate_cover_button = b = CB(_('&Generate cover'), 'default_cover.png', self.generate_cover) - b.m = m = QMenu() + b.m = m = QMenu(b) b.setMenu(m) m.addAction(QIcon(I('config.png')), _('Customize the styles and colors of the generated cover'), self.custom_cover) b.setPopupMode(b.DelayedPopup)