Do sidebar switch check in browser init

https://github.com/ankitects/help-wanted/issues/6#issuecomment-706880794
This commit is contained in:
abdo 2020-10-12 10:26:53 +03:00
parent 82993d16fd
commit 7c1b855709
2 changed files with 3 additions and 5 deletions

View File

@ -586,10 +586,10 @@ class Browser(QMainWindow):
col: Collection
editor: Optional[Editor]
def __init__(self, mw: AnkiQt, want_old_sidebar: bool = False) -> None:
def __init__(self, mw: AnkiQt) -> None:
QMainWindow.__init__(self, None, Qt.Window)
self.mw = mw
self.want_old_sidebar = want_old_sidebar
self.want_old_sidebar = mw.app.queryKeyboardModifiers() & Qt.ShiftModifier
self.col = self.mw.col
self.lastFilter = ""
self.focusTo: Optional[int] = None

View File

@ -1062,9 +1062,7 @@ title="%s" %s>%s</button>""" % (
aqt.dialogs.open("AddCards", self)
def onBrowse(self) -> None:
aqt.dialogs.open(
"Browser", self, self.app.queryKeyboardModifiers() & Qt.ShiftModifier
)
aqt.dialogs.open("Browser", self)
def onEditCurrent(self):
aqt.dialogs.open("EditCurrent", self)