diff --git a/nw/gui/theme.py b/nw/gui/theme.py index 04a00c0e..e1025664 100644 --- a/nw/gui/theme.py +++ b/nw/gui/theme.py @@ -32,7 +32,7 @@ import nw from os import path, listdir from PyQt5.QtWidgets import qApp -from PyQt5.QtGui import QPalette, QColor, QIcon +from PyQt5.QtGui import QPalette, QColor, QIcon, QFontMetrics from nw.constants import nwAlert from nw.gui.icons import GuiIcons @@ -119,8 +119,20 @@ class GuiTheme: self.loadDecoration = self.theIcons.loadDecoration # Extract Other Info - self.defFont = qApp.font() - self.defFontSize = self.defFont.pointSizeF() + self.guiDPI = qApp.primaryScreen().physicalDotsPerInch() + self.guiFont = qApp.font() + + qMetric = QFontMetrics(self.guiFont) + self.fontPointSize = self.guiFont.pointSizeF() + self.fontPixelSize = qMetric.height() + self.baseIconSize = qMetric.ascent() + self.textIconSize = qMetric.ascent() + qMetric.leading() + + logger.verbose("GUI Font Family: %s" % self.guiFont.family()) + logger.verbose("GUI Font Point Size: %.2f" % self.fontPointSize) + logger.verbose("GUI Font Pixel Size: %.2f" % self.fontPixelSize) + logger.verbose("GUI Base Icon Size: %.2f" % self.baseIconSize) + logger.verbose("GUI Text Icon Size: %.2f" % self.textIconSize) return