The correct fix for tree widget font sizes, issue #273

This commit is contained in:
Veronica K. B. Olsen
2020-06-06 10:36:50 +02:00
parent 896d7f1257
commit 7723f24c12
6 changed files with 0 additions and 39 deletions
-4
View File
@@ -1,7 +1,3 @@
/**
* Default Theme: Light
*/
QTreeView, QHeaderView {
font-size: 13px;
}
@@ -1,7 +1,3 @@
/**
* Default Theme: Dark
*/
QTreeView, QHeaderView {
font-size: 13px;
}
-5
View File
@@ -339,8 +339,6 @@ class GuiProjectOutline(QTreeWidget):
headItem.setTextAlignment(self.colIndex[nwOutline.CCOUNT], Qt.AlignRight)
headItem.setTextAlignment(self.colIndex[nwOutline.WCOUNT], Qt.AlignRight)
headItem.setTextAlignment(self.colIndex[nwOutline.PCOUNT], Qt.AlignRight)
for hItem in self.treeOrder:
headItem.setFont(self.colIndex[hItem], self.theTheme.guiFont)
currTitle = None
currChapter = None
@@ -433,9 +431,6 @@ class GuiProjectOutline(QTreeWidget):
newItem.setText(self.colIndex[nwOutline.ENTITY], ", ".join(theRefs[nwKeyWords.ENTITY_KEY]))
newItem.setText(self.colIndex[nwOutline.CUSTOM], ", ".join(theRefs[nwKeyWords.CUSTOM_KEY]))
for i in self.treeOrder:
newItem.setFont(self.colIndex[i], self.theTheme.guiFont)
return newItem
# END Class GuiProjectOutline
-6
View File
@@ -92,9 +92,6 @@ class GuiProjectLoad(QDialog):
treeHead = self.listBox.headerItem()
treeHead.setTextAlignment(1, Qt.AlignRight)
treeHead.setTextAlignment(2, Qt.AlignRight)
treeHead.setFont(0, self.theTheme.guiFont)
treeHead.setFont(1, self.theTheme.guiFont)
treeHead.setFont(2, self.theTheme.guiFont)
self.lblRecent = QLabel("<b>Recently Opened Projects</b>")
self.lblPath = QLabel("<b>Path</b>")
@@ -260,9 +257,6 @@ class GuiProjectLoad(QDialog):
newItem.setTextAlignment(0, Qt.AlignLeft | Qt.AlignVCenter)
newItem.setTextAlignment(1, Qt.AlignRight | Qt.AlignVCenter)
newItem.setTextAlignment(2, Qt.AlignRight | Qt.AlignVCenter)
newItem.setFont(0, self.theTheme.guiFont)
newItem.setFont(1, self.theTheme.guiFont)
newItem.setFont(2, self.theTheme.guiFont)
self.listBox.addTopLevelItem(newItem)
if not hasSelection:
newItem.setSelected(True)
-8
View File
@@ -450,14 +450,8 @@ class GuiProjectEditReplace(QWidget):
self.listBox.itemSelectionChanged.connect(self._selectedItem)
self.listBox.setIndentation(0)
treeHead = self.listBox.headerItem()
treeHead.setFont(0, self.theTheme.guiFont)
treeHead.setFont(1, self.theTheme.guiFont)
for aKey, aVal in self.theProject.autoReplace.items():
newItem = QTreeWidgetItem(["<%s>" % aKey, aVal])
newItem.setFont(0, self.theTheme.guiFont)
newItem.setFont(1, self.theTheme.guiFont)
self.listBox.addTopLevelItem(newItem)
self.listBox.sortByColumn(0, Qt.AscendingOrder)
@@ -548,8 +542,6 @@ class GuiProjectEditReplace(QWidget):
saveKey = "<keyword%d>" % (self.listBox.topLevelItemCount() + 1)
newVal = ""
newItem = QTreeWidgetItem([saveKey, newVal])
newItem.setFont(0, self.theTheme.guiFont)
newItem.setFont(1, self.theTheme.guiFont)
self.listBox.addTopLevelItem(newItem)
return True
-12
View File
@@ -79,14 +79,6 @@ class GuiProjectTree(QTreeWidget):
treeHeadItem.setToolTip(self.C_EXPORT, "Include in build")
treeHeadItem.setToolTip(self.C_FLAGS, "Status, class, and layout flags")
# Force the font to fix font sizing issues on some platforms
# like Ubuntu. This must also be set when the rows are added.
self.setFont(self.theTheme.guiFont)
treeHeadItem.setFont(self.C_NAME, self.theTheme.guiFont)
treeHeadItem.setFont(self.C_COUNT,self.theTheme.guiFont)
treeHeadItem.setFont(self.C_EXPORT, self.theTheme.guiFont)
treeHeadItem.setFont(self.C_FLAGS, self.theTheme.guiFont)
# Let the last column stretch, and set the minimum size to the
# size of the icon as the default Qt font metrics approach fails
# for some fonts like the Ubuntu font.
@@ -599,10 +591,6 @@ class GuiProjectTree(QTreeWidget):
newItem.setTextAlignment(self.C_EXPORT, Qt.AlignLeft | Qt.AlignVCenter)
newItem.setTextAlignment(self.C_FLAGS, Qt.AlignLeft | Qt.AlignVCenter)
newItem.setFont(self.C_NAME, self.theTheme.guiFont)
newItem.setFont(self.C_COUNT, self.theTheme.guiFont)
newItem.setFont(self.C_FLAGS, self.theTheme.guiFont)
newItem.setData(self.C_NAME, Qt.UserRole, tHandle)
self.theMap[tHandle] = newItem