Skip to content

Commit

Permalink
v1.1.3
Browse files Browse the repository at this point in the history
implements lovac42's toolbar package
  • Loading branch information
ccz-2 committed Mar 29, 2020
1 parent abfccfb commit abc20d5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
5 changes: 3 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Anki Zoom
# v1.1.2 3/8/2020
# v1.1.3 3/28/2020
# Copyright (c) 2020 Quip13 ([email protected])
# Based in part on code by Damien Elmes <[email protected]>, Roland Sieker <[email protected]> and github.com/krassowski
# Big thanks to u/Glutanimate and u/yumenogotoshi for code suggestions
Expand All @@ -12,6 +12,7 @@
from anki.hooks import addHook, runHook, wrap
from anki.hooks import *
from anki.lang import _
from .toolbar import *

def configUpdated(*args):
global scrl_threshold
Expand Down Expand Up @@ -110,7 +111,7 @@ def setup_menu():
try:
mw.addon_view_menu
except AttributeError:
mw.addon_view_menu = QMenu(_('&View'), mw)
mw.addon_view_menu = getMenu(mw, "&View")
mw.form.menubar.insertMenu(
mw.form.menuTools.menuAction(),
mw.addon_view_menu
Expand Down
2 changes: 1 addition & 1 deletion config.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Anki Zoom v1.1.2 Config:
### Anki Zoom v1.1.3 Config:
All config is effective immediately. If having issues, please click "Restore Defaults".

- `deckBrowser_zoom_default`: Zoom level that the reset button applies for the deck browser. Must be >`0.2` and <`5`
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"package": "538879081",
"ankiweb_id": "538879081",
"author": "Quip13",
"human_version": "v1.1",
"human_version": "v1.1.3",
"homepage": "https://ankiweb.net/shared/info/538879081",
"conflicts": [ "1846592880" ]
}
28 changes: 28 additions & 0 deletions toolbar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Lovac42
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html


from aqt import QMenu

def getMenu(parent, menuName):
menu = None
for a in parent.form.menubar.actions():
if menuName == a.text():
menu = a.menu()
break
if not menu:
menu = parent.form.menubar.addMenu(menuName)
return menu


def getSubMenu(menu, subMenuName):
subMenu = None
for a in menu.actions():
if subMenuName == a.text():
subMenu = a.menu()
break
if not subMenu:
subMenu = QMenu(subMenuName, menu)
menu.addMenu(subMenu)
return subMenu
Binary file modified zoom.ankiaddon
Binary file not shown.

0 comments on commit abc20d5

Please sign in to comment.