mirror of
https://github.com/ankitects/anki.git
synced 2025-11-12 07:37:11 -05:00
hide accels in browser too
This commit is contained in:
parent
7c1178eed5
commit
557c8e9ce4
2 changed files with 9 additions and 3 deletions
|
|
@ -387,6 +387,7 @@ class Browser(QMainWindow):
|
||||||
c(self.tagCut3, SIGNAL("activated()"), self.onMark)
|
c(self.tagCut3, SIGNAL("activated()"), self.onMark)
|
||||||
# add-on hook
|
# add-on hook
|
||||||
runHook('browser.setupMenus', self)
|
runHook('browser.setupMenus', self)
|
||||||
|
self.mw.maybeHideAccelerators(self)
|
||||||
|
|
||||||
def updateFont(self):
|
def updateFont(self):
|
||||||
self.form.tableView.verticalHeader().setDefaultSectionSize(
|
self.form.tableView.verticalHeader().setDefaultSectionSize(
|
||||||
|
|
|
||||||
11
aqt/main.py
11
aqt/main.py
|
|
@ -983,20 +983,25 @@ will be lost. Continue?"""))
|
||||||
ws.setFontSize(QWebSettings.DefaultFontSize, self.fontHeight)
|
ws.setFontSize(QWebSettings.DefaultFontSize, self.fontHeight)
|
||||||
|
|
||||||
def setupSystemSpecific(self):
|
def setupSystemSpecific(self):
|
||||||
|
self.hideMenuAccels = False
|
||||||
if isMac:
|
if isMac:
|
||||||
qt_mac_set_menubar_icons(False)
|
qt_mac_set_menubar_icons(False)
|
||||||
# mac users expect a minimize option
|
# mac users expect a minimize option
|
||||||
self.minimizeShortcut = QShortcut("Ctrl+M", self)
|
self.minimizeShortcut = QShortcut("Ctrl+M", self)
|
||||||
self.connect(self.minimizeShortcut, SIGNAL("activated()"),
|
self.connect(self.minimizeShortcut, SIGNAL("activated()"),
|
||||||
self.onMacMinimize)
|
self.onMacMinimize)
|
||||||
self.hideAccelerators()
|
self.hideMenuAccels = True
|
||||||
|
self.maybeHideAccelerators()
|
||||||
self.hideStatusTips()
|
self.hideStatusTips()
|
||||||
elif isWin:
|
elif isWin:
|
||||||
# make sure ctypes is bundled
|
# make sure ctypes is bundled
|
||||||
from ctypes import windll, wintypes
|
from ctypes import windll, wintypes
|
||||||
|
|
||||||
def hideAccelerators(self):
|
def maybeHideAccelerators(self, tgt=None):
|
||||||
for action in self.findChildren(QAction):
|
if not self.hideMenuAccels:
|
||||||
|
return
|
||||||
|
tgt = tgt or self
|
||||||
|
for action in tgt.findChildren(QAction):
|
||||||
txt = unicode(action.text())
|
txt = unicode(action.text())
|
||||||
m = re.match("^(.+)\(&.+\)(.+)?", txt)
|
m = re.match("^(.+)\(&.+\)(.+)?", txt)
|
||||||
if m:
|
if m:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue