mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
allow user to override scaling
which may help wth issues like https://anki.tenderapp.com/discussions/beta-testing/918-text-size-in-ubuntu-1710 and https://anki.tenderapp.com/discussions/ankidesktop/25708-anki-with-high-dpi-screen
This commit is contained in:
parent
77bb67a555
commit
41205bd5ca
2 changed files with 8 additions and 3 deletions
|
|
@ -258,8 +258,9 @@ def _run(argv=None, exec=True):
|
||||||
import ctypes
|
import ctypes
|
||||||
ctypes.CDLL('libGL.so.1', ctypes.RTLD_GLOBAL)
|
ctypes.CDLL('libGL.so.1', ctypes.RTLD_GLOBAL)
|
||||||
|
|
||||||
# opt in to full hidpi support
|
# opt in to full hidpi support?
|
||||||
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
|
if not os.environ.get("ANKI_NOHIGHDPI"):
|
||||||
|
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
|
||||||
|
|
||||||
# create the app
|
# create the app
|
||||||
app = AnkiApp(argv)
|
app = AnkiApp(argv)
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,11 @@ class AnkiWebView(QWebEngineView):
|
||||||
oldFocus.setFocus()
|
oldFocus.setFocus()
|
||||||
|
|
||||||
def zoomFactor(self):
|
def zoomFactor(self):
|
||||||
from aqt import mw
|
# overridden scale factor?
|
||||||
|
webscale = os.environ.get("ANKI_WEBSCALE")
|
||||||
|
if webscale:
|
||||||
|
return float(webscale)
|
||||||
|
|
||||||
if isMac:
|
if isMac:
|
||||||
return 1
|
return 1
|
||||||
screen = QApplication.desktop().screen()
|
screen = QApplication.desktop().screen()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue