Rename main theme object

This commit is contained in:
Veronica Berglyd Olsen
2022-06-11 16:29:49 +02:00
parent db01d85f2e
commit 985179bbb9
26 changed files with 346 additions and 346 deletions
+9 -9
View File
@@ -73,7 +73,7 @@ class GuiBuildNovel(QDialog):
self.mainConf = novelwriter.CONFIG
self.mainGui = mainGui
self.theTheme = mainGui.theTheme
self.mainTheme = mainGui.mainTheme
self.theProject = mainGui.theProject
self.htmlText = [] # List of html documents
@@ -93,7 +93,7 @@ class GuiBuildNovel(QDialog):
self.docView = GuiBuildNovelDocView(self, self.theProject)
hS = self.theTheme.fontPixelSize
hS = self.mainTheme.fontPixelSize
wS = 2*hS
# Title Formats
@@ -238,11 +238,11 @@ class GuiBuildNovel(QDialog):
pOptions.getString("GuiBuildNovel", "textFont", self.mainConf.textFont)
)
self.fontButton = QPushButton("...")
self.fontButton.setMaximumWidth(int(2.5*self.theTheme.getTextWidth("...")))
self.fontButton.setMaximumWidth(int(2.5*self.mainTheme.getTextWidth("...")))
self.fontButton.clicked.connect(self._selectFont)
self.textSize = QSpinBox(self)
self.textSize.setFixedWidth(6*self.theTheme.textNWidth)
self.textSize.setFixedWidth(6*self.mainTheme.textNWidth)
self.textSize.setMinimum(6)
self.textSize.setMaximum(72)
self.textSize.setSingleStep(1)
@@ -251,7 +251,7 @@ class GuiBuildNovel(QDialog):
)
self.lineHeight = QDoubleSpinBox(self)
self.lineHeight.setFixedWidth(6*self.theTheme.textNWidth)
self.lineHeight.setFixedWidth(6*self.mainTheme.textNWidth)
self.lineHeight.setMinimum(0.8)
self.lineHeight.setMaximum(3.0)
self.lineHeight.setSingleStep(0.05)
@@ -1201,10 +1201,10 @@ class GuiBuildNovelDocView(QTextBrowser):
self.mainConf = novelwriter.CONFIG
self.theProject = theProject
self.mainGui = mainGui
self.theTheme = mainGui.theTheme
self.mainTheme = mainGui.mainTheme
self.buildTime = 0
self.setMinimumWidth(40*self.mainGui.theTheme.textNWidth)
self.setMinimumWidth(40*self.mainGui.mainTheme.textNWidth)
self.setOpenExternalLinks(False)
self.document().setDocumentMargin(self.mainConf.getTextMargin())
@@ -1238,9 +1238,9 @@ class GuiBuildNovelDocView(QTextBrowser):
lblPalette.setColor(QPalette.Foreground, lblPalette.toolTipText().color())
lblFont = self.font()
lblFont.setPointSizeF(0.9*self.theTheme.fontPointSize)
lblFont.setPointSizeF(0.9*self.mainTheme.fontPointSize)
fPx = int(1.1*self.theTheme.fontPixelSize)
fPx = int(1.1*self.mainTheme.fontPixelSize)
self.theTitle = QLabel("", self)
self.theTitle.setIndent(0)
+4 -4
View File
@@ -48,9 +48,9 @@ class GuiLipsum(QDialog):
logger.debug("Initialising GuiLipsum ...")
self.setObjectName("GuiLipsum")
self.mainConf = novelwriter.CONFIG
self.mainGui = mainGui
self.theTheme = mainGui.theTheme
self.mainConf = novelwriter.CONFIG
self.mainGui = mainGui
self.mainTheme = mainGui.mainTheme
self.setWindowTitle(self.tr("Insert Placeholder Text"))
@@ -61,7 +61,7 @@ class GuiLipsum(QDialog):
nPx = self.mainConf.pxInt(64)
vSp = self.mainConf.pxInt(4)
self.docIcon = QLabel()
self.docIcon.setPixmap(self.mainGui.theTheme.getPixmap("proj_document", (nPx, nPx)))
self.docIcon.setPixmap(self.mainTheme.getPixmap("proj_document", (nPx, nPx)))
self.leftBox = QVBoxLayout()
self.leftBox.setSpacing(vSp)
+8 -8
View File
@@ -54,11 +54,11 @@ class GuiProjectWizard(QWizard):
logger.debug("Initialising GuiProjectWizard ...")
self.setObjectName("GuiProjectWizard")
self.mainConf = novelwriter.CONFIG
self.mainGui = mainGui
self.theTheme = mainGui.theTheme
self.mainConf = novelwriter.CONFIG
self.mainGui = mainGui
self.mainTheme = mainGui.mainTheme
self.sideImage = self.theTheme.loadDecoration(
self.sideImage = self.mainTheme.loadDecoration(
"wiz-back", None, self.mainConf.pxInt(370)
)
self.setWizardStyle(QWizard.ModernStyle)
@@ -92,7 +92,7 @@ class ProjWizardIntroPage(QWizardPage):
self.mainConf = novelwriter.CONFIG
self.theWizard = theWizard
self.theTheme = theWizard.theTheme
self.mainTheme = theWizard.mainTheme
self.setTitle(self.tr("Create New Project"))
self.theText = QLabel(self.tr(
@@ -107,7 +107,7 @@ class ProjWizardIntroPage(QWizardPage):
"Peter Mitterhofer", "CC BY-SA 4.0"
))
lblFont = self.imgCredit.font()
lblFont.setPointSizeF(0.6*self.theTheme.fontPointSize)
lblFont.setPointSizeF(0.6*self.mainTheme.fontPointSize)
self.imgCredit.setFont(lblFont)
xW = self.mainConf.pxInt(300)
@@ -162,7 +162,7 @@ class ProjWizardFolderPage(QWizardPage):
self.mainConf = novelwriter.CONFIG
self.theWizard = theWizard
self.theTheme = theWizard.theTheme
self.mainTheme = theWizard.mainTheme
self.setTitle(self.tr("Select Project Folder"))
self.theText = QLabel(self.tr(
@@ -180,7 +180,7 @@ class ProjWizardFolderPage(QWizardPage):
self.projPath.setPlaceholderText(self.tr("Required"))
self.browseButton = QPushButton("...")
self.browseButton.setMaximumWidth(int(2.5*self.theTheme.getTextWidth("...")))
self.browseButton.setMaximumWidth(int(2.5*self.mainTheme.getTextWidth("...")))
self.browseButton.clicked.connect(self._doBrowse)
self.errLabel = QLabel("")
+14 -14
View File
@@ -65,7 +65,7 @@ class GuiWritingStats(QDialog):
self.mainConf = novelwriter.CONFIG
self.mainGui = mainGui
self.theTheme = mainGui.theTheme
self.mainTheme = mainGui.mainTheme
self.theProject = mainGui.theProject
self.logData = []
@@ -125,7 +125,7 @@ class GuiWritingStats(QDialog):
self.listBox.setSortingEnabled(True)
# Word Bar
self.barHeight = int(round(0.5*self.theTheme.fontPixelSize))
self.barHeight = int(round(0.5*self.mainTheme.fontPixelSize))
self.barWidth = self.mainConf.pxInt(200)
self.barImage = QPixmap(self.barHeight, self.barHeight)
self.barImage.fill(self.palette().highlight().color())
@@ -136,27 +136,27 @@ class GuiWritingStats(QDialog):
self.infoBox.setLayout(self.infoForm)
self.labelTotal = QLabel(formatTime(0))
self.labelTotal.setFont(self.theTheme.guiFontFixed)
self.labelTotal.setFont(self.mainTheme.guiFontFixed)
self.labelTotal.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
self.labelIdleT = QLabel(formatTime(0))
self.labelIdleT.setFont(self.theTheme.guiFontFixed)
self.labelIdleT.setFont(self.mainTheme.guiFontFixed)
self.labelIdleT.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
self.labelFilter = QLabel(formatTime(0))
self.labelFilter.setFont(self.theTheme.guiFontFixed)
self.labelFilter.setFont(self.mainTheme.guiFontFixed)
self.labelFilter.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
self.novelWords = QLabel("0")
self.novelWords.setFont(self.theTheme.guiFontFixed)
self.novelWords.setFont(self.mainTheme.guiFontFixed)
self.novelWords.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
self.notesWords = QLabel("0")
self.notesWords.setFont(self.theTheme.guiFontFixed)
self.notesWords.setFont(self.mainTheme.guiFontFixed)
self.notesWords.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
self.totalWords = QLabel("0")
self.totalWords.setFont(self.theTheme.guiFontFixed)
self.totalWords.setFont(self.mainTheme.guiFontFixed)
self.totalWords.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
lblTTime = QLabel(self.tr("Total Time:"))
@@ -183,7 +183,7 @@ class GuiWritingStats(QDialog):
self.infoForm.setRowStretch(6, 1)
# Filter Options
sPx = self.theTheme.baseIconSize
sPx = self.mainTheme.baseIconSize
self.filterBox = QGroupBox(self.tr("Filters"), self)
self.filterForm = QGridLayout(self)
@@ -605,13 +605,13 @@ class GuiWritingStats(QDialog):
newItem.setTextAlignment(self.C_COUNT, Qt.AlignRight)
newItem.setTextAlignment(self.C_BAR, Qt.AlignLeft | Qt.AlignVCenter)
newItem.setFont(self.C_TIME, self.theTheme.guiFontFixed)
newItem.setFont(self.C_LENGTH, self.theTheme.guiFontFixed)
newItem.setFont(self.C_COUNT, self.theTheme.guiFontFixed)
newItem.setFont(self.C_TIME, self.mainTheme.guiFontFixed)
newItem.setFont(self.C_LENGTH, self.mainTheme.guiFontFixed)
newItem.setFont(self.C_COUNT, self.mainTheme.guiFontFixed)
if showIdleTime:
newItem.setFont(self.C_IDLE, self.theTheme.guiFontFixed)
newItem.setFont(self.C_IDLE, self.mainTheme.guiFontFixed)
else:
newItem.setFont(self.C_IDLE, self.theTheme.guiFont)
newItem.setFont(self.C_IDLE, self.mainTheme.guiFont)
self.listBox.addTopLevelItem(newItem)
self.timeFilter += sDiff