Change the name and alpha format of colour themes

This commit is contained in:
Veronica Berglyd Olsen
2025-06-03 12:02:38 +02:00
parent b0ea1781e7
commit 82188d156b
14 changed files with 84 additions and 86 deletions
+2 -2
View File
@@ -54,7 +54,7 @@ background = #363636
text = default
link = blue
headertext = green
headertag = green, 160
headertag = green:160
emphasis = orange
dialog = blue
altdialog = blue
@@ -69,4 +69,4 @@ spellcheckline = red
errorline = green
replacetag = green
modifier = green
texthighlight = yellow, 72
texthighlight = yellow:72
+1 -1
View File
@@ -54,7 +54,7 @@ background = #ffffff
text = #000000
link = blue
headertext = green
headertag = green, 160
headertag = green:160
emphasis = orange
dialog = blue
altdialog = blue
+2 -2
View File
@@ -73,7 +73,7 @@ background = #fbfbfb
text = default
link = blue
headertext = blue
headertag = blue, 160
headertag = blue:160
emphasis = orange
dialog = green
altdialog = yellow
@@ -88,4 +88,4 @@ spellcheckline = red
errorline = green
replacetag = aqua
modifier = green
texthighlight = yellow, 96
texthighlight = yellow:96
+2 -2
View File
@@ -73,7 +73,7 @@ background = #011627
text = default
link = blue
headertext = blue
headertag = blue, 160
headertag = blue:160
emphasis = orange
dialog = green
altdialog = yellow
@@ -88,4 +88,4 @@ spellcheckline = red
errorline = green
replacetag = aqua
modifier = green
texthighlight = yellow, 96
texthighlight = yellow:96
+3 -3
View File
@@ -63,7 +63,7 @@ background = #2e3436
text = default
link = blue
headertext = blue
headertag = blue, 160
headertag = blue:160
emphasis = orange
dialog = green
altdialog = yellow
@@ -76,6 +76,6 @@ value = red
optional = blue
spellcheckline = red
errorline = green
replacetag = cyan
replacetag = aqua
modifier = blue
texthighlight = yellow, 96
texthighlight = yellow:96
+5 -5
View File
@@ -1,6 +1,6 @@
[Main]
name = Tango Light
mode = light
name = Tango Light
mode = light
author = Veronica Berglyd Olsen (adaptation)
##
@@ -63,7 +63,7 @@ background = #eeeeec
text = default
link = blue
headertext = blue
headertag = blue, 160
headertag = blue:160
emphasis = orange
dialog = green
altdialog = yellow
@@ -76,6 +76,6 @@ value = red
optional = blue
spellcheckline = red
errorline = green
replacetag = cyan
replacetag = aqua
modifier = blue
texthighlight = yellow, 96
texthighlight = yellow:96
+2 -2
View File
@@ -73,7 +73,7 @@ background = #ffffff
text = #4d4d4c
link = blue
headertext = blue
headertag = blue, 160
headertag = blue:160
emphasis = orange
dialog = green
altdialog = yellow
@@ -88,4 +88,4 @@ spellcheckline = red
errorline = green
replacetag = aqua
modifier = orange
texthighlight = yellow, 96
texthighlight = yellow:96
@@ -73,7 +73,7 @@ background = #1d1f21
text = default
link = blue
headertext = blue
headertag = blue, 160
headertag = blue:160
emphasis = orange
dialog = green
altdialog = yellow
@@ -88,4 +88,4 @@ spellcheckline = red
errorline = green
replacetag = aqua
modifier = orange
texthighlight = yellow, 96
texthighlight = yellow:96
@@ -73,7 +73,7 @@ background = #002451
text = default
link = blue
headertext = blue
headertag = blue, 160
headertag = blue:160
emphasis = orange
dialog = green
altdialog = yellow
@@ -88,4 +88,4 @@ spellcheckline = red
errorline = green
replacetag = aqua
modifier = orange
texthighlight = yellow, 96
texthighlight = yellow:96
@@ -73,7 +73,7 @@ background = #000000
text = default
link = blue
headertext = blue
headertag = blue, 160
headertag = blue:160
emphasis = orange
dialog = green
altdialog = yellow
@@ -88,4 +88,4 @@ spellcheckline = red
errorline = green
replacetag = aqua
modifier = orange
texthighlight = yellow, 96
texthighlight = yellow:96
@@ -73,7 +73,7 @@ background = #2d2d2d
text = default
link = blue
headertext = blue
headertag = blue, 160
headertag = blue:160
emphasis = orange
dialog = green
altdialog = yellow
@@ -88,4 +88,4 @@ spellcheckline = red
errorline = green
replacetag = aqua
modifier = orange
texthighlight = yellow, 96
texthighlight = yellow:96
+6 -6
View File
@@ -82,10 +82,6 @@ class GuiSideBar(QWidget):
self.tbTheme.setToolTip(self.tr("Switch Colour Theme"))
self.tbTheme.clicked.connect(self._cycleColurTheme)
self.tbBuild = NIconToolButton(self, iSz)
self.tbBuild.setToolTip("{0} [F5]".format(self.tr("Build Manuscript")))
self.tbBuild.clicked.connect(self.mainGui.showBuildManuscriptDialog)
self.tbDetails = NIconToolButton(self, iSz)
self.tbDetails.setToolTip("{0} [Shift+F6]".format(self.tr("Novel Details")))
self.tbDetails.clicked.connect(self.mainGui.showNovelDetailsDialog)
@@ -94,6 +90,10 @@ class GuiSideBar(QWidget):
self.tbStats.setToolTip("{0} [F6]".format(self.tr("Writing Statistics")))
self.tbStats.clicked.connect(self.mainGui.showWritingStatsDialog)
self.tbBuild = NIconToolButton(self, iSz)
self.tbBuild.setToolTip("{0} [F5]".format(self.tr("Build Manuscript")))
self.tbBuild.clicked.connect(self.mainGui.showBuildManuscriptDialog)
# Settings Menu
self.tbSettings = NIconToolButton(self, iSz)
self.tbSettings.setToolTip(self.tr("Settings"))
@@ -114,9 +114,9 @@ class GuiSideBar(QWidget):
self.outerBox.addWidget(self.tbOutline)
self.outerBox.addWidget(self.tbBuild)
self.outerBox.addStretch(1)
self.outerBox.addWidget(self.tbTheme)
self.outerBox.addWidget(self.tbDetails)
self.outerBox.addWidget(self.tbStats)
self.outerBox.addWidget(self.tbTheme)
self.outerBox.addWidget(self.tbSettings)
self.outerBox.setContentsMargins(0, 0, 0, 0)
self.outerBox.setSpacing(6)
@@ -137,9 +137,9 @@ class GuiSideBar(QWidget):
self.tbSearch.setStyleSheet(buttonStyle)
self.tbOutline.setStyleSheet(buttonStyle)
self.tbBuild.setStyleSheet(buttonStyle)
self.tbTheme.setStyleSheet(buttonStyle)
self.tbDetails.setStyleSheet(buttonStyle)
self.tbStats.setStyleSheet(buttonStyle)
self.tbTheme.setStyleSheet(buttonStyle)
self.tbSettings.setStyleSheet(buttonStyle)
self.tbProject.setThemeIcon("sb_project")
+17 -19
View File
@@ -229,27 +229,25 @@ class GuiTheme:
if value in self._qColors:
# Named colour
return self._qColors[value]
elif value.startswith("#"):
if len(value) >= 9:
# Convert from #RRGGBBAA to #AARRGGBB
return QColor.fromString(f"#{value[7:9]}{value[1:7]}")
else:
# Assume #RRGGBB
return QColor.fromString(value[:7])
elif value.startswith("#") and len(value) == 7:
# Assume #RRGGBB
return QColor.fromString(value)
elif value.startswith("#") and len(value) == 9:
# Assume #RRGGBBAA and convert to #AARRGGBB
return QColor.fromString(f"#{value[7:9]}{value[1:7]}")
elif ":" in value:
# Colour name and alpha
name, _, alpha = value.partition(":")
color = QColor(self._qColors.get(name.strip(), default))
color.setAlpha(checkInt(alpha, 255))
return color
elif "," in value:
# Integer red, green, blue, alpha
data = value.split(",")
entries = len(data)
if entries == 2:
# Assume name, alpha
color = QColor(self._qColors.get(data[0].strip(), default))
color.setAlpha(checkInt(data[1], 255))
return color
else:
# Assume red, green, blue, alpha
result = [0, 0, 0, 255]
for i in range(min(entries, 4)):
result[i] = checkInt(data[i].strip(), result[i])
return QColor(*result)
result = [0, 0, 0, 255]
for i in range(min(len(data), 4)):
result[i] = checkInt(data[i].strip(), result[i])
return QColor(*result)
return default
def loadTheme(self, force: bool = False) -> bool: