parkouss / webmacs

webmacs - keyboard driven (emacs key bindings) browser, https://webmacs.readthedocs.io/en/latest/
GNU General Public License v3.0
156 stars 21 forks source link

Expose default zoom in variable #110

Open codesections opened 5 years ago

codesections commented 5 years ago

Thanks very much for webmacs! I'm strongly considering switching from qutebrowser!

Before I can do so, though, I'll need to resolve one issue: the default zoom is significantly too low (likely because I have a hdpi screen). I'd like to be able to set the default zoom level in my config file, but I cannot currently find a way to do so.

Would it be possible to expose the default zoom as one of the variables? That way, I could set it, and I'd know that it's part of the supported API.

Or, if there's a different, supported way to set the default zoom level, please let me know! Thanks again for the project.

TLATER commented 5 years ago

I wouldn't call it supported per-se, but it's pretty easy to do with Qt internals in your init file:

from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication

QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)

Admittedly, I think it's probably worth adding into an FAQ for workarounds or something. Either that or I get off my ass and write something to properly handle Xorg dpi settings.

xantoz commented 5 years ago

You can also define the environment variable QT_SCALE_FACTOR. Try:

QT_SCALE_FACTOR=1.5 webmacs

This should work for any Qt program.

See: https://doc.qt.io/qt-5/highdpi.html