[improvement][settings] new property 'ui.scale_factor' responsible for defining the interface scale factor

This commit is contained in:
Vinicius Moreira
2020-06-24 12:23:05 -03:00
parent cab309b023
commit 1088966991
16 changed files with 117 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import os
import sys
import traceback
import urllib3
from PyQt5.QtCore import QCoreApplication, Qt
@@ -25,6 +26,13 @@ def main(tray: bool = False):
os.environ['QT_AUTO_SCREEN_SCALE_FACTOR'] = '1'
logger.info("Auto screen scale factor activated")
try:
scale_factor = float(app_config['ui']['scale_factor'])
os.environ['QT_SCALE_FACTOR'] = str(scale_factor)
logger.info("Scale factor set to {}".format(scale_factor))
except:
traceback.print_exc()
if bool(app_config['ui']['hdpi']):
logger.info("HDPI settings activated")
QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)