Handling of window size and change

This commit is contained in:
Veronica K. B. Olsen
2019-04-06 21:58:48 +02:00
parent 4867b49562
commit 2ed9fb12de
3 changed files with 67 additions and 36 deletions
+14
View File
@@ -52,8 +52,13 @@ class Config:
self.confChanged = False
## General
self.guiTheme = "default"
self.winGeometry = [1100, 650]
self.treeColWidth = [120, 30, 50]
self.mainPanePos = [300, 800]
## Text Editor
self.textWidth = 600
# Check if config file exists
if path.isfile(path.join(self.confPath,self.confFile)):
@@ -88,6 +93,10 @@ class Config:
self.treeColWidth = self.unpackList(
confParser.get(cnfSec,"treecols"), 3, self.treeColWidth
)
if confParser.has_option(cnfSec,"mainpane"):
self.mainPanePos = self.unpackList(
confParser.get(cnfSec,"mainpane"), 2, self.mainPanePos
)
## Path
cnfSec = "Path"
@@ -111,6 +120,7 @@ class Config:
confParser.set(cnfSec,"timestamp", datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
confParser.set(cnfSec,"geometry", self.packList(self.winGeometry))
confParser.set(cnfSec,"treecols", self.packList(self.treeColWidth))
confParser.set(cnfSec,"mainpane", self.packList(self.mainPanePos))
## Path
cnfSec = "Path"
@@ -170,4 +180,8 @@ class Config:
self.treeColWidth = colWidths
return
def setMainPanePos(self, panePos):
self.mainPanePos = panePos
return
# End Class Config