Created
May 29, 2017 00:49
-
-
Save sirneb/fb665941b68996428fc1565c78ea9601 to your computer and use it in GitHub Desktop.
Anki Advanced Mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Copyright: Damien Elmes <anki@ichi2.net> | |
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html | |
# | |
# This plugin adds the ability to toggle full screen mode. | |
# | |
# Modified to hide menu bar when in fullscreen mode (Glutanimate, 2016) | |
# | |
from aqt import mw | |
from PyQt4.QtGui import * | |
from PyQt4.QtCore import * | |
def onFullScreen(): | |
if mw.windowState() == Qt.WindowFullScreen: | |
mw.setWindowState(mw.windowState() ^ Qt.WindowFullScreen) | |
mw.menuBar().show() | |
mw.toolbar.web.show() | |
mw.bottomWeb.show() | |
else: | |
mw.setWindowState(mw.windowState() ^ Qt.WindowFullScreen) | |
mw.menuBar().hide() | |
mw.toolbar.web.hide() | |
mw.bottomWeb.hide() | |
action = QAction("Full Screen", mw) | |
mw.connect(action, SIGNAL("triggered()"), onFullScreen) | |
action.setShortcut("F11") | |
mw.addAction(action) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment