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
This commit is contained in:
Kovid Goyal 2020-09-26 14:39:57 +05:30
parent 2162b4f597
commit 1b1de7242b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1113,7 +1113,7 @@ class Cover(ImageView): # {{{
b.setToolTip(_( b.setToolTip(_(
'Automatically detect and remove extra space at the cover\'s edges.\n' 'Automatically detect and remove extra space at the cover\'s edges.\n'
'Pressing it repeatedly can sometimes remove stubborn borders.')) 'Pressing it repeatedly can sometimes remove stubborn borders.'))
b.m = m = QMenu() b.m = m = QMenu(b)
b.setPopupMode(QToolButton.InstantPopup) b.setPopupMode(QToolButton.InstantPopup)
m.addAction(QIcon(I('trim.png')), _('Automatically trim borders'), self.trim_cover) m.addAction(QIcon(I('trim.png')), _('Automatically trim borders'), self.trim_cover)
m.addSeparator() m.addSeparator()
@ -1124,7 +1124,7 @@ class Cover(ImageView): # {{{
self.download_cover_button = CB(_('Download co&ver'), 'arrow-down.png', self.download_cover) 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) 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) b.setMenu(m)
m.addAction(QIcon(I('config.png')), _('Customize the styles and colors of the generated cover'), self.custom_cover) m.addAction(QIcon(I('config.png')), _('Customize the styles and colors of the generated cover'), self.custom_cover)
b.setPopupMode(b.DelayedPopup) b.setPopupMode(b.DelayedPopup)