mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Allow full screen mode on new Qt6 drivers (#2660)
* Allow full screen mode on new Qt6 drivers * Update fulscreen warning message
This commit is contained in:
parent
30ae9f7c54
commit
8b0d663fd0
3 changed files with 5 additions and 11 deletions
|
@ -55,7 +55,7 @@ actions-previous-card-info = Previous Card Info
|
||||||
# By convention, the name of a menu action is suffixed with "..." if additional
|
# By convention, the name of a menu action is suffixed with "..." if additional
|
||||||
# input is required before it can be performed. E.g. "Export..." vs. "Delete".
|
# input is required before it can be performed. E.g. "Export..." vs. "Delete".
|
||||||
actions-with-ellipsis = { $action }...
|
actions-with-ellipsis = { $action }...
|
||||||
actions-currently-unsupported = This action is currently not supported on your system.
|
actions-fullscreen-unsupported = Full screen mode is not supported for your video driver. Try switching to a different one from the preferences screen.
|
||||||
|
|
||||||
## Flags
|
## Flags
|
||||||
|
|
||||||
|
|
|
@ -1365,7 +1365,7 @@ title="{}" {}>{}</button>""".format(
|
||||||
def on_toggle_full_screen(self) -> None:
|
def on_toggle_full_screen(self) -> None:
|
||||||
if disallow_full_screen():
|
if disallow_full_screen():
|
||||||
showWarning(
|
showWarning(
|
||||||
tr.actions_currently_unsupported(),
|
tr.actions_fullscreen_unsupported(),
|
||||||
parent=self,
|
parent=self,
|
||||||
help=HelpPage.FULL_SCREEN_ISSUE,
|
help=HelpPage.FULL_SCREEN_ISSUE,
|
||||||
)
|
)
|
||||||
|
|
|
@ -1074,19 +1074,13 @@ def qtMenuShortcutWorkaround(qmenu: QMenu) -> None:
|
||||||
|
|
||||||
|
|
||||||
def disallow_full_screen() -> bool:
|
def disallow_full_screen() -> bool:
|
||||||
"""Test for OpenGl on Windows, which is known to cause issues with full screen mode.
|
"""Test for OpenGl on Windows, which is known to cause issues with full screen mode."""
|
||||||
On Qt6, the driver is not detectable, so check if it has been set explicitly.
|
|
||||||
"""
|
|
||||||
from aqt import mw
|
from aqt import mw
|
||||||
from aqt.profiles import VideoDriver
|
from aqt.profiles import VideoDriver
|
||||||
|
|
||||||
return is_win and (
|
return is_win and (
|
||||||
(qtmajor == 5 and mw.pm.video_driver() == VideoDriver.OpenGL)
|
mw.pm.video_driver() == VideoDriver.OpenGL
|
||||||
or (
|
|
||||||
qtmajor == 6
|
|
||||||
and not os.environ.get("ANKI_SOFTWAREOPENGL")
|
and not os.environ.get("ANKI_SOFTWAREOPENGL")
|
||||||
and os.environ.get("QT_OPENGL") != "software"
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue