Scale factor calculated from logical dpi
This commit is contained in:
+2
-2
@@ -172,7 +172,7 @@ def main(sysArgs=None):
|
||||
debugLevel = logging.INFO
|
||||
elif inOpt == "--debug":
|
||||
debugLevel = logging.DEBUG
|
||||
logFormat = "[{asctime:}] {name:>20}:{lineno:<4d} {levelname:8} {message:}"
|
||||
logFormat = "[{asctime:}] {name:>22}:{lineno:<4d} {levelname:8} {message:}"
|
||||
elif inOpt == "--logfile":
|
||||
logFile = inArg
|
||||
toFile = True
|
||||
@@ -180,7 +180,7 @@ def main(sysArgs=None):
|
||||
toStd = False
|
||||
elif inOpt == "--verbose":
|
||||
debugLevel = VERBOSE
|
||||
logFormat = "[{asctime:}] {name:>20}:{lineno:<4d} {levelname:8} {message:}"
|
||||
logFormat = "[{asctime:}] {name:>22}:{lineno:<4d} {levelname:8} {message:}"
|
||||
elif inOpt == "--style":
|
||||
qtStyle = inArg
|
||||
elif inOpt == "--config":
|
||||
|
||||
+6
-2
@@ -132,9 +132,13 @@ class GuiTheme:
|
||||
self.loadDecoration = self.theIcons.loadDecoration
|
||||
|
||||
# Extract Other Info
|
||||
self.guiDPI = qApp.primaryScreen().physicalDotsPerInch()
|
||||
self.guiFont = qApp.font()
|
||||
self.guiDPI = qApp.primaryScreen().physicalDotsPerInchX()
|
||||
self.guiScale = qApp.primaryScreen().logicalDotsPerInchX()/96.0
|
||||
self.mainConf.guiScale = self.guiScale
|
||||
logger.verbose("GUI DPI: %.1f" % self.guiDPI)
|
||||
logger.verbose("GUI Scale: %.2f" % self.guiScale)
|
||||
|
||||
self.guiFont = qApp.font()
|
||||
qMetric = QFontMetrics(self.guiFont)
|
||||
self.fontPointSize = self.guiFont.pointSizeF()
|
||||
self.fontPixelSize = int(round(qMetric.height()))
|
||||
|
||||
Reference in New Issue
Block a user