mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
Add fullscreen shortcut (#1488)
This commit is contained in:
parent
63316f763d
commit
90e7ee2e18
1 changed files with 12 additions and 0 deletions
|
@ -157,6 +157,7 @@ class AnkiQt(QMainWindow):
|
||||||
self.setup_timers()
|
self.setup_timers()
|
||||||
self.updateTitleBar()
|
self.updateTitleBar()
|
||||||
self.setup_focus()
|
self.setup_focus()
|
||||||
|
self.setup_shortcuts()
|
||||||
# screens
|
# screens
|
||||||
self.setupDeckBrowser()
|
self.setupDeckBrowser()
|
||||||
self.setupOverview()
|
self.setupOverview()
|
||||||
|
@ -191,6 +192,17 @@ class AnkiQt(QMainWindow):
|
||||||
def on_focus_changed(self, old: QWidget, new: QWidget) -> None:
|
def on_focus_changed(self, old: QWidget, new: QWidget) -> None:
|
||||||
gui_hooks.focus_did_change(new, old)
|
gui_hooks.focus_did_change(new, old)
|
||||||
|
|
||||||
|
def setup_shortcuts(self) -> None:
|
||||||
|
QShortcut(
|
||||||
|
QKeySequence("Ctrl+Meta+F" if isMac else "F11"),
|
||||||
|
self,
|
||||||
|
self.on_toggle_fullscreen,
|
||||||
|
).setContext(Qt.ShortcutContext.ApplicationShortcut)
|
||||||
|
|
||||||
|
def on_toggle_fullscreen(self) -> None:
|
||||||
|
window = self.app.activeWindow()
|
||||||
|
window.setWindowState(window.windowState() ^ Qt.WindowState.WindowFullScreen)
|
||||||
|
|
||||||
# Profiles
|
# Profiles
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue