All fixed sizes should no be passed through the pxInt function

This commit is contained in:
Veronica K. B. Olsen
2020-06-04 21:58:35 +02:00
parent 0e467d5fb1
commit 8b22deb1f4
17 changed files with 164 additions and 134 deletions
+14 -11
View File
@@ -108,15 +108,15 @@ class GuiMain(QMainWindow):
# Assemble Main Window
self.treePane = QWidget()
self.treeBox = QVBoxLayout()
self.treeBox.setContentsMargins(0,0,0,0)
self.treeBox.setContentsMargins(0, 0, 0, 0)
self.treeBox.addWidget(self.treeView)
self.treeBox.addWidget(self.treeMeta)
self.treePane.setLayout(self.treeBox)
self.editPane = QWidget()
self.docEdit = QVBoxLayout()
self.docEdit.setContentsMargins(0,0,0,0)
self.docEdit.setSpacing(2)
self.docEdit.setContentsMargins(0, 0, 0, 0)
self.docEdit.setSpacing(self.mainConf.pxInt(2))
self.docEdit.addWidget(self.searchBar)
self.docEdit.addWidget(self.noticeBar)
self.docEdit.addWidget(self.docEditor)
@@ -124,8 +124,8 @@ class GuiMain(QMainWindow):
self.viewPane = QWidget()
self.docView = QVBoxLayout()
self.docView.setContentsMargins(0,0,0,0)
self.docView.setSpacing(2)
self.docView.setContentsMargins(0, 0, 0, 0)
self.docView.setSpacing(self.mainConf.pxInt(2))
self.docView.addWidget(self.docViewer)
self.docView.addWidget(self.viewMeta)
self.docView.setStretch(0, 1)
@@ -148,8 +148,9 @@ class GuiMain(QMainWindow):
self.tabWidget.addTab(self.splitOutline, "Outline")
self.tabWidget.currentChanged.connect(self._mainTabChanged)
xCM = self.mainConf.pxInt(4)
self.splitMain = QSplitter(Qt.Horizontal)
self.splitMain.setContentsMargins(4,4,4,4)
self.splitMain.setContentsMargins(xCM, xCM, xCM, xCM)
self.splitMain.setOpaqueResize(False)
self.splitMain.addWidget(self.treePane)
self.splitMain.addWidget(self.tabWidget)
@@ -513,9 +514,9 @@ class GuiMain(QMainWindow):
if not self.viewPane.isVisible():
bPos = self.splitMain.sizes()
self.viewPane.setVisible(True)
vPos = [0,0]
vPos = [0, 0]
vPos[0] = int(bPos[1]/2)
vPos[1] = bPos[1]-vPos[0]
vPos[1] = bPos[1] - vPos[0]
self.splitView.setSizes(vPos)
self.docViewer.navigateTo(navLink)
@@ -877,7 +878,7 @@ class GuiMain(QMainWindow):
self.theProject.setLastViewed(None)
bPos = self.splitMain.sizes()
self.viewPane.setVisible(False)
vPos = [bPos[1],0]
vPos = [bPos[1], 0]
self.splitView.setSizes(vPos)
return not self.viewPane.isVisible()
@@ -988,16 +989,18 @@ class GuiMain(QMainWindow):
def _makeStatusIcons(self):
self.statusIcons = {}
iPx = self.mainConf.pxInt(32)
for sLabel, sCol, _ in self.theProject.statusItems:
theIcon = QPixmap(32,32)
theIcon = QPixmap(iPx, iPx)
theIcon.fill(QColor(*sCol))
self.statusIcons[sLabel] = QIcon(theIcon)
return
def _makeImportIcons(self):
self.importIcons = {}
iPx = self.mainConf.pxInt(32)
for sLabel, sCol, _ in self.theProject.importItems:
theIcon = QPixmap(32,32)
theIcon = QPixmap(iPx, iPx)
theIcon.fill(QColor(*sCol))
self.importIcons[sLabel] = QIcon(theIcon)
return