mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix global menubar not working in OS X with Qt 5.6
This commit is contained in:
parent
e61c047395
commit
7d7fcd312a
@ -366,13 +366,18 @@ if isosx:
|
|||||||
t.setInterval(200), t.setSingleShot(True), t.timeout.connect(self.refresh_bar)
|
t.setInterval(200), t.setSingleShot(True), t.timeout.connect(self.refresh_bar)
|
||||||
|
|
||||||
def init_bar(self, actions):
|
def init_bar(self, actions):
|
||||||
|
mb = self.native_menubar
|
||||||
|
if mb.parent() is None:
|
||||||
|
# Without this the menubar does not update correctly with Qt >=
|
||||||
|
# 5.6. See the last couple of lines in updateMenuBarImmediately
|
||||||
|
# in qcocoamenubar.mm
|
||||||
|
mb.setParent(self.gui)
|
||||||
self.last_actions = actions
|
self.last_actions = actions
|
||||||
for ac in self.added_actions:
|
for ac in self.added_actions:
|
||||||
m = ac.menu()
|
m = ac.menu()
|
||||||
if m is not None:
|
if m is not None:
|
||||||
m.setVisible(False)
|
m.setVisible(False)
|
||||||
|
|
||||||
mb = self.native_menubar
|
|
||||||
for ac in self.added_actions:
|
for ac in self.added_actions:
|
||||||
mb.removeAction(ac)
|
mb.removeAction(ac)
|
||||||
if ac is not self.donate_action:
|
if ac is not self.donate_action:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user