From 7c1b855709e49fe4d62ee38b245054addf4535c3 Mon Sep 17 00:00:00 2001 From: abdo Date: Mon, 12 Oct 2020 10:26:53 +0300 Subject: [PATCH] Do sidebar switch check in browser init https://github.com/ankitects/help-wanted/issues/6#issuecomment-706880794 --- qt/aqt/browser.py | 4 ++-- qt/aqt/main.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index 424490045..c94fef39c 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -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 diff --git a/qt/aqt/main.py b/qt/aqt/main.py index b5708c672..a20ea514e 100644 --- a/qt/aqt/main.py +++ b/qt/aqt/main.py @@ -1062,9 +1062,7 @@ title="%s" %s>%s""" % ( 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)