Merge branch 'master' into gui_tweaks

This commit is contained in:
Veronica K. B. Olsen
2020-05-31 13:09:49 +02:00
4 changed files with 21 additions and 22 deletions
+5 -9
View File
@@ -29,7 +29,7 @@ import logging
import nw
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont, QIcon, QPixmap, QFontMetrics
from PyQt5.QtGui import QFont, QIcon, QPixmap
from PyQt5.QtWidgets import QFrame, QGridLayout, QLabel
from nw.constants import (
@@ -66,10 +66,6 @@ class GuiDocDetails(QFrame):
self.fntLabel.setBold(True)
self.fntLabel.setPointSizeF(self.pS)
self.fntFixed = QFont()
self.fntFixed.setFamily("Monospace")
self.fntFixed.setPointSizeF(self.pS)
self.fntValue = QFont()
self.fntValue.setPointSizeF(self.pS)
@@ -104,7 +100,7 @@ class GuiDocDetails(QFrame):
self.className.setAlignment(Qt.AlignLeft)
self.classFlag = QLabel("")
self.classFlag.setFont(self.fntFixed)
self.classFlag.setFont(self.fntValue)
self.classFlag.setAlignment(Qt.AlignRight)
self.classData = QLabel("")
@@ -117,7 +113,7 @@ class GuiDocDetails(QFrame):
self.layoutName.setAlignment(Qt.AlignLeft)
self.layoutFlag = QLabel("")
self.layoutFlag.setFont(self.fntFixed)
self.layoutFlag.setFont(self.fntValue)
self.layoutFlag.setAlignment(Qt.AlignRight)
self.layoutData = QLabel("")
@@ -181,8 +177,8 @@ class GuiDocDetails(QFrame):
self.mainBox.setColumnStretch(4,0)
# Make sure the columns for flags and counts don't resize too often
flagWidth = QFontMetrics(self.fntFixed).boundingRect("Mm").width()
countWidth = QFontMetrics(self.fntValue).boundingRect("99,999").width()
flagWidth = self.theTheme.getTextWidth("Mm", self.fntValue)
countWidth = self.theTheme.getTextWidth("99,999", self.fntValue)
self.mainBox.setColumnMinimumWidth(1, flagWidth)
self.mainBox.setColumnMinimumWidth(4, countWidth)
-7
View File
@@ -99,10 +99,6 @@ class GuiDocTree(QTreeWidget):
self.resizeColumnToContents(self.C_EXPORT)
self.resizeColumnToContents(self.C_FLAGS)
self.fntFixed = QFont()
self.fntFixed.setFamily("Monospace")
self.fntFixed.setPointSizeF(0.9*self.theTheme.fontPointSize)
logger.debug("DocTree initialisation complete")
# Internal Mapping
@@ -582,10 +578,7 @@ class GuiDocTree(QTreeWidget):
newItem.setText(self.C_FLAGS, "")
newItem.setText(self.C_HANDLE, tHandle)
# newItem.setForeground(self.C_COUNT,QColor(*self.theParent.theTheme.treeWCount))
newItem.setTextAlignment(self.C_COUNT, Qt.AlignRight)
# newItem.setTextAlignment(self.C_EXPORT, Qt.AlignHCenter)
newItem.setFont(self.C_FLAGS, self.fntFixed)
self.theMap[tHandle] = newItem
if pHandle is None: