Added functions for calculating scaled sizes

This commit is contained in:
Veronica K. B. Olsen
2020-06-04 21:27:56 +02:00
parent 8e7c3dcb4b
commit 0e467d5fb1
2 changed files with 14 additions and 1 deletions
+12 -1
View File
@@ -88,6 +88,7 @@ class Config:
self.guiLang = "en" # Hardcoded for now
self.guiFont = ""
self.guiFontSize = 11
self.guiScale = 1.0
## Sizes
self.winGeometry = [1100, 650]
@@ -197,7 +198,17 @@ class Config:
return
##
# Actions
# Methods
##
def pxInt(self, theSize):
return int(self.guiScale*theSize)
def pxFloat(self, theSize):
return self.guiScale*theSize
##
# Config Actions
##
def initConfig(self, confPath=None, dataPath=None):
+2
View File
@@ -148,6 +148,8 @@ class GuiTheme:
logger.verbose("GUI Font Pixel Size: %d" % self.fontPixelSize)
logger.verbose("GUI Base Icon Size: %d" % self.baseIconSize)
logger.verbose("GUI Text Icon Size: %d" % self.textIconSize)
logger.verbose("Text 'N' Height: %d" % self.textNHeight)
logger.verbose("Text 'N' Width: %d" % self.textNWidth)
return