mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 23:27:12 -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)
|
||||
# add-on hook
|
||||
runHook('browser.setupMenus', self)
|
||||
self.mw.maybeHideAccelerators(self)
|
||||
|
||||
def updateFont(self):
|
||||
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)
|
||||
|
||||
def setupSystemSpecific(self):
|
||||
self.hideMenuAccels = False
|
||||
if isMac:
|
||||
qt_mac_set_menubar_icons(False)
|
||||
# mac users expect a minimize option
|
||||
self.minimizeShortcut = QShortcut("Ctrl+M", self)
|
||||
self.connect(self.minimizeShortcut, SIGNAL("activated()"),
|
||||
self.onMacMinimize)
|
||||
self.hideAccelerators()
|
||||
self.hideMenuAccels = True
|
||||
self.maybeHideAccelerators()
|
||||
self.hideStatusTips()
|
||||
elif isWin:
|
||||
# make sure ctypes is bundled
|
||||
from ctypes import windll, wintypes
|
||||
|
||||
def hideAccelerators(self):
|
||||
for action in self.findChildren(QAction):
|
||||
def maybeHideAccelerators(self, tgt=None):
|
||||
if not self.hideMenuAccels:
|
||||
return
|
||||
tgt = tgt or self
|
||||
for action in tgt.findChildren(QAction):
|
||||
txt = unicode(action.text())
|
||||
m = re.match("^(.+)\(&.+\)(.+)?", txt)
|
||||
if m:
|
||||
|
|
|
|||
Loading…
Reference in a new issue