Add more theme fields (#2384)

This commit is contained in:
Veronica Berglyd Olsen
2025-06-05 22:03:57 +02:00
committed by GitHub
26 changed files with 412 additions and 303 deletions
@@ -8,6 +8,7 @@ license = CC BY-SA 4.0
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
[Base]
base = #000000
default = #888888
faded = #616161
red = #f24817
@@ -26,11 +27,14 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #000000
window = base
windowtext = #969696
base = #000000
base = base
alternatebase = #282828
text = #969696
tooltipbase = #281446
@@ -42,6 +46,7 @@ highlight = #321e50
highlightedtext = #ffffff
link = blue
linkvisited = #320050
accent = #321e50
[GUI]
helptext = faded
@@ -49,7 +54,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #000000
background = base
text = #969696
link = blue
headertext = #ffffff
+12 -7
View File
@@ -9,10 +9,11 @@ license = CC BY-SA 4.0
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
[Base]
base = #373737
default = #cccccc
faded = #949494
red = #f2777a
orange = #f99139
red = #ff6666
orange = #ff9966
yellow = #ffcc66
green = #99cc99
cyan = #66cccc
@@ -27,22 +28,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #363636
window = #303030
windowtext = default
base = #3e3e3e
base = base
alternatebase = #4e4e4e
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #3e3e3e
button = base
buttontext = default
brighttext = #3e3e3e
brighttext = base
highlight = #2c98f7
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = #2c98f7
[GUI]
helptext = #a4a4a4
@@ -50,7 +55,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #363636
background = base
text = default
link = blue
headertext = green
+16 -11
View File
@@ -9,11 +9,12 @@ license = CC BY-SA 4.0
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
[Base]
base = #fcfcfc
default = #303030
faded = #6c6c6c
red = #a62a2d
orange = #b36829
yellow = #a68542
yellow = #a39c34
green = #296629
cyan = #269999
blue = #3a70a6
@@ -27,22 +28,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #efefef
windowtext = #000000
base = #ffffff
windowtext = default
base = base
alternatebase = #e0e0e0
text = #000000
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #efefef
buttontext = #000000
brighttext = #ffffff
buttontext = default
brighttext = base
highlight = #3087c6
highlightedtext = #ffffff
highlightedtext = base
link = blue
linkvisited = blue
accent = #3087c6
[GUI]
helptext = #5c5c5c
@@ -50,15 +55,15 @@ fadedtext = #6c6c6c
errortext = red
[Syntax]
background = #ffffff
text = #000000
background = base
text = default
link = blue
headertext = green
headertag = green:L135
emphasis = orange
dialog = blue
altdialog = blue
note = yellow
note = yellow:D125
hidden = faded
shortcode = green
keyword = red
@@ -69,4 +74,4 @@ spellcheckline = red
errorline = green
replacetag = green
modifier = green
texthighlight = #c8c80060
texthighlight = yellow:72
+9 -4
View File
@@ -25,6 +25,7 @@ licenseurl = https://github.com/dracula/dracula-theme/blob/main/LICENSE
##
[Base]
base = #282a36
default = #e6e6e0
faded = #6272a4
red = #ff5555
@@ -43,22 +44,26 @@ title = green
chapter = red
scene = cyan
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #44475a
windowtext = #f8f8f2
base = #282a36
base = base
alternatebase = #333645
text = #f8f8f2
tooltipbase = yellow
tooltiptext = #282a36
tooltiptext = base
button = #505369
buttontext = #f8f8f2
brighttext = #44475a
brighttext = base
highlight = #a681da
highlightedtext = #f8f8f2
link = cyan
linkvisited = cyan
accent = #a681da
[GUI]
helptext = #ccacf9
@@ -66,7 +71,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #282a36
background = base
text = #f8f8f2
link = #ff79c6
headertext = purple
+8 -3
View File
@@ -8,6 +8,7 @@ license = CC BY-SA 4.0
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
[Base]
base = #3e3e3e
default = #c8c8c8
faded = #949494
red = #f2777a
@@ -26,22 +27,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #363636
windowtext = default
base = #3e3e3e
base = base
alternatebase = #4e4e4e
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #3e3e3e
button = base
buttontext = default
brighttext = #3e3e3e
brighttext = base
highlight = #2c98f7
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = #2c98f7
[GUI]
helptext = default:D120
+9 -4
View File
@@ -8,6 +8,7 @@ license = CC BY-SA 4.0
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
[Base]
base = #ffffff
default = #282828
faded = #6c6c6c
red = #a62a2d
@@ -26,22 +27,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #efefef
windowtext = default
base = #ffffff
base = base
alternatebase = #e0e0e0
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #efefef
buttontext = default
brighttext = #ffffff
brighttext = base
highlight = #3087c6
highlightedtext = #ffffff
highlightedtext = base
link = blue
linkvisited = blue
accent = #3087c6
[GUI]
helptext = default:L225
@@ -49,7 +54,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #ffffff
background = base
text = default
link = default
headertext = default:D200
+9 -4
View File
@@ -28,6 +28,7 @@ licenseurl = https://github.com/sdras/night-owl-vscode-theme/blob/master/LICENSE
##
[Base]
base = #fbfbfb
default = #403f52
faded = #989fb1
red = #de3d3a
@@ -46,22 +47,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #eaeaea
windowtext = default
base = #fbfbfb
base = base
alternatebase = #e0e0e0
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #eaeaea
button = base
buttontext = default
brighttext = #eaeaea
brighttext = base
highlight = #3087c6
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = #3087c6
[GUI]
helptext = blue
@@ -69,7 +74,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #fbfbfb
background = base
text = default
link = blue
headertext = blue
+9 -4
View File
@@ -28,6 +28,7 @@ licenseurl = https://github.com/sdras/night-owl-vscode-theme/blob/master/LICENSE
##
[Base]
base = #011627
default = #d6deeb
faded = #637777
red = #f78c6c
@@ -46,22 +47,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #434652
windowtext = default
base = #011627
base = base
alternatebase = #32374d
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #434652
button = base
buttontext = default
brighttext = #434652
brighttext = base
highlight = #2c98f7
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = #2c98f7
[GUI]
helptext = blue
@@ -69,7 +74,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #011627
background = base
text = default
link = blue
headertext = blue
+8 -3
View File
@@ -8,6 +8,7 @@ license = MIT License
licenseurl = https://github.com/primer/brand/blob/main/LICENSE
[Base]
base = #0c1117
default = #f0f6fc
faded = #a3b0be
red = #ff7b72
@@ -26,15 +27,18 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #141b23
windowtext = default
base = #0c1117
base = base
alternatebase = #1e242a
text = default
tooltipbase = yellow
tooltiptext = #0c1117
tooltiptext = base
button = #212830
buttontext = default
brighttext = default
@@ -42,6 +46,7 @@ highlight = #104C35
highlightedtext = default
link = blue
linkvisited = blue
accent = #104C35
[GUI]
helptext = faded
@@ -49,7 +54,7 @@ fadedtext = faded:128
errortext = #f85149
[Syntax]
background = #0c1117
background = base
text = faded
link = blue
headertext = default
+7 -2
View File
@@ -8,6 +8,7 @@ license = MIT License
licenseurl = https://github.com/primer/brand/blob/main/LICENSE
[Base]
base = #ffffff
default = #1f2328
faded = #59636e
red = #fa4549
@@ -26,11 +27,14 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #eaeef2
windowtext = default
base = #ffffff
base = base
alternatebase = #dfe4e9
text = default
tooltipbase = #fae17d
@@ -42,6 +46,7 @@ highlight = #dafbe1
highlightedtext = #1a7f37
link = blue
linkvisited = blue
accent = #dafbe1
[GUI]
helptext = faded
@@ -49,7 +54,7 @@ fadedtext = faded:128
errortext = #cf222e
[Syntax]
background = #ffffff
background = base
text = faded
link = blue
headertext = default
+9 -4
View File
@@ -21,6 +21,7 @@ licenseurl = https://github.com/loilo/vscode-snazzy-light/blob/master/LICENSE
##
[Base]
base = #fafbfc
default = #565869
faded = #545554
red = #ff5c57
@@ -39,22 +40,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #f3f4f5
windowtext = default
base = #fafbfc
base = base
alternatebase = #eaeaeb
text = default
tooltipbase = #f5e9c2
tooltiptext = default
button = #fafbfc
button = base
buttontext = default
brighttext = #ffffff
brighttext = base
highlight = blue
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = blue
[GUI]
helptext = blue
@@ -62,7 +67,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #fafbfc
background = base
text = default
link = blue
headertext = green
@@ -27,6 +27,7 @@ licenseurl = https://github.com/altercation/solarized/blob/master/LICENSE
##
[Base]
base = #073642
default = #fdf6e3
faded = #eee8d5
red = #dc322f
@@ -45,22 +46,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #002b36
windowtext = default
base = #073642
base = base
alternatebase = #586e75
text = default
tooltipbase = yellow
tooltiptext = #002b36
button = #073642
button = base
buttontext = default
brighttext = #073642
brighttext = base
highlight = cyan
highlightedtext = default
link = blue
linkvisited = blue
accent = cyan
[GUI]
helptext = cyan
@@ -68,7 +73,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #073642
background = base
text = default
link = blue
headertext = default:D125
@@ -27,6 +27,7 @@ licenseurl = https://github.com/altercation/solarized/blob/master/LICENSE
##
[Base]
base = #eee8d5
default = #002b36
faded = #073642
red = #dc322f
@@ -45,23 +46,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #fdf6e3
windowtext = default
base = #eee8d5
base = base
alternatebase = #93a1a1
text = default
tooltipbase = yellow
tooltiptext = #002b36
button = #eee8d5
button = base
buttontext = default
brighttext = #eee8d5
brighttext = base
highlight = cyan
highlightedtext = default
link = blue
linkvisited = blue
accent = cyan
[GUI]
helptext = cyan
@@ -69,7 +73,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #eee8d5
background = base
text = default
link = blue
headertext = default:L125
+7 -2
View File
@@ -18,6 +18,7 @@ author = Veronica Berglyd Olsen (adaptation)
##
[Base]
base = #2e3436
default = #eeeeec
faded = #babdb6
red = #ef2929
@@ -36,11 +37,14 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #555753
windowtext = default
base = #2e3436
base = base
alternatebase = #454e51
text = default
tooltipbase = #ffffc0
@@ -52,6 +56,7 @@ highlight = blue
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = blue
[GUI]
helptext = orange
@@ -59,7 +64,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #2e3436
background = base
text = default
link = blue
headertext = blue
+7 -2
View File
@@ -18,6 +18,7 @@ author = Veronica Berglyd Olsen (adaptation)
##
[Base]
base = #eeeeec
default = #2e3436
faded = #888a85
red = #a40000
@@ -36,11 +37,14 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #d3d7cf
windowtext = default
base = #eeeeec
base = base
alternatebase = #e0e0e0
text = default
tooltipbase = #ffffc0
@@ -52,6 +56,7 @@ highlight = blue:L200
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = blue:L150
[GUI]
helptext = orange
@@ -59,7 +64,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #eeeeec
background = base
text = default
link = blue
headertext = blue
+8 -3
View File
@@ -28,6 +28,7 @@ licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.
##
[Base]
base = #ffffff
default = #484848
faded = #6c6c6c
red = #c82829
@@ -46,11 +47,14 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #efefef
windowtext = #000000
base = #ffffff
base = base
alternatebase = #d6d6d6
text = #000000
tooltipbase = #ffffc0
@@ -59,9 +63,10 @@ button = #efefef
buttontext = #000000
brighttext = #efefef
highlight = blue
highlightedtext = #ffffff
highlightedtext = base
link = blue
linkvisited = blue
accent = blue
[GUI]
helptext = #5c5c5c
@@ -69,7 +74,7 @@ fadedtext = faded
errortext = red
[Syntax]
background = #ffffff
background = base
text = #4d4d4c
link = blue
headertext = blue
@@ -28,6 +28,7 @@ licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.
##
[Base]
base = #1d1f21
default = #c5c8c6
faded = #969896
red = #cc6666
@@ -46,22 +47,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #282a2e
windowtext = default
base = #1d1f21
base = base
alternatebase = #373b41
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #1d1f21
button = base
buttontext = default
brighttext = #1d1f21
brighttext = base
highlight = #2c98f7
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = #2c98f7
[GUI]
helptext = #a4a4a4
@@ -69,7 +74,7 @@ fadedtext = #949494
errortext = red
[Syntax]
background = #1d1f21
background = base
text = default
link = blue
headertext = blue
@@ -28,6 +28,7 @@ licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.
##
[Base]
base = #002451
default = #ffffff
faded = #7285b7
red = #ff9da4
@@ -46,22 +47,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #00346e
windowtext = default
base = #002451
base = base
alternatebase = #003f8e
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #002451
button = base
buttontext = default
brighttext = #002451
brighttext = base
highlight = #2c98f7
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = #2c98f7
[GUI]
helptext = #a4a4a4
@@ -69,7 +74,7 @@ fadedtext = #949494
errortext = red
[Syntax]
background = #002451
background = base
text = default
link = blue
headertext = blue
@@ -28,6 +28,7 @@ licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.
##
[Base]
base = #000000
default = #eaeaea
faded = #969896
red = #d54e53
@@ -46,22 +47,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #2a2a2a
windowtext = default
base = #000000
base = base
alternatebase = #424242
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #000000
button = base
buttontext = default
brighttext = #000000
brighttext = base
highlight = #2c98f7
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = #2c98f7
[GUI]
helptext = #a4a4a4
@@ -69,7 +74,7 @@ fadedtext = #949494
errortext = red
[Syntax]
background = #000000
background = base
text = default
link = blue
headertext = blue
@@ -28,6 +28,7 @@ licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.
##
[Base]
base = #2d2d2d
default = #cccccc
faded = #999999
red = #f2777a
@@ -46,22 +47,26 @@ title = green
chapter = red
scene = blue
note = yellow
active = green
inactive = red
disabled = faded
[Palette]
window = #393939
windowtext = default
base = #2d2d2d
base = base
alternatebase = #515151
text = default
tooltipbase = #ffffc0
tooltiptext = #15150d
button = #2d2d2d
button = base
buttontext = default
brighttext = #2d2d2d
brighttext = base
highlight = #2c98f7
highlightedtext = #ffffff
link = blue
linkvisited = blue
accent = #2c98f7
[GUI]
helptext = #a4a4a4
@@ -69,7 +74,7 @@ fadedtext = #949494
errortext = red
[Syntax]
background = #2d2d2d
background = base
text = default
link = blue
headertext = blue
+1
View File
@@ -445,6 +445,7 @@ class nwLabels:
THEME_COLORS: Final[dict[str, str]] = {
"theme": QT_TRANSLATE_NOOP("Constant", "Theme Colours"),
"default": QT_TRANSLATE_NOOP("Constant", "Foreground Colour"),
"base": QT_TRANSLATE_NOOP("Constant", "Background Colour"),
"faded": QT_TRANSLATE_NOOP("Constant", "Faded Colour"),
"red": QT_TRANSLATE_NOOP("Constant", "Red"),
"orange": QT_TRANSLATE_NOOP("Constant", "Orange"),
+4 -4
View File
@@ -363,13 +363,13 @@ class NWItem:
"""
if self.isFileType():
key = "checked" if self._active else "unchecked"
color = "green" if self._active else "red"
color = "active" if self._active else "inactive"
text = trConst(nwLabels.ACTIVE_NAME[key])
icon = SHARED.theme.getIcon(key, color)
else:
key = "noncheckable"
color = "disabled"
text = ""
icon = SHARED.theme.getIcon("noncheckable", "faded")
return text, icon
return text, SHARED.theme.getIcon(key, color)
##
# Checker Methods
+5 -2
View File
@@ -33,7 +33,7 @@ from novelwriter.types import QtNoPen, QtPaintAntiAlias, QtSizeFixed
class NSwitch(QAbstractButton):
__slots__ = ("_offset", "_rH", "_rR", "_xH", "_xR", "_xW")
__slots__ = ("_cOff", "_cOn", "_offset", "_rH", "_rR", "_xH", "_xR", "_xW")
def __init__(self, parent: QWidget, height: int = 0) -> None:
super().__init__(parent=parent)
@@ -44,6 +44,9 @@ class NSwitch(QAbstractButton):
self._rH = self._xH - 4
self._rR = self._xR - 2
self._cOn = SHARED.theme.accentCol
self._cOff = self.palette().alternateBase()
self.setCheckable(True)
self.setSizePolicy(QtSizeFixed, QtSizeFixed)
self.setFixedWidth(self._xW)
@@ -97,7 +100,7 @@ class NSwitch(QAbstractButton):
painter.setOpacity(1.0 if self.isEnabled() else 0.5)
painter.setPen(palette.highlight().color() if self.hasFocus() else palette.mid().color())
painter.setBrush(palette.highlight() if self.isChecked() else palette.alternateBase())
painter.setBrush(self._cOn if self.isChecked() else self._cOff)
painter.drawRoundedRect(0, 0, self._xW, self._xH, self._xR, self._xR)
painter.setPen(QtNoPen)
+2 -8
View File
@@ -233,14 +233,8 @@ class GuiItemDetails(QWidget):
# Label
# =====
if nwItem.isFileType():
if nwItem.isActive:
self.labelIcon.setPixmap(SHARED.theme.getPixmap("checked", (iPx, iPx), "green"))
else:
self.labelIcon.setPixmap(SHARED.theme.getPixmap("unchecked", (iPx, iPx), "red"))
else:
self.labelIcon.setPixmap(SHARED.theme.getPixmap("noncheckable", (iPx, iPx), "faded"))
_, icon = nwItem.getActiveStatus()
self.labelIcon.setPixmap(icon.pixmap(iPx, iPx))
self.labelData.setText(elide(nwItem.itemName, 100))
# Status
+15 -4
View File
@@ -108,7 +108,7 @@ class GuiTheme:
__slots__ = (
"_allThemes", "_currentTheme", "_darkThemes", "_guiPalette", "_lightThemes", "_meta",
"_qColors", "_styleSheets", "_svgColors", "_syntaxList", "baseButtonHeight",
"_qColors", "_styleSheets", "_svgColors", "_syntaxList", "accentCol", "baseButtonHeight",
"baseIconHeight", "baseIconSize", "buttonIconSize", "errorText", "fadedText",
"fontPixelSize", "fontPointSize", "getDecoration", "getHeaderDecoration",
"getHeaderDecorationNarrow", "getIcon", "getItemIcon", "getPixmap", "getToggleIcon",
@@ -123,10 +123,11 @@ class GuiTheme:
self.syntaxTheme = SyntaxColors()
self.isDarkTheme = False
# Special Text Colours
# Special Colours
self.helpText = QColor(0, 0, 0)
self.fadedText = QColor(0, 0, 0)
self.errorText = QColor(255, 0, 0)
self.accentCol = QColor(255, 0, 255) # Needed until we move to Qt 6.6
# Theme Data
self._meta = ThemeMeta()
@@ -306,6 +307,7 @@ class GuiTheme:
# Base
sec = "Base"
if parser.has_section(sec):
self._setBaseColor("base", self._readColor(parser, sec, "base"))
self._setBaseColor("default", self._readColor(parser, sec, "default"))
self._setBaseColor("faded", self._readColor(parser, sec, "faded"))
self._setBaseColor("red", self._readColor(parser, sec, "red"))
@@ -326,6 +328,9 @@ class GuiTheme:
self._setBaseColor("chapter", self._readColor(parser, sec, "chapter"))
self._setBaseColor("scene", self._readColor(parser, sec, "scene"))
self._setBaseColor("note", self._readColor(parser, sec, "note"))
self._setBaseColor("active", self._readColor(parser, sec, "active"))
self._setBaseColor("inactive", self._readColor(parser, sec, "inactive"))
self._setBaseColor("disabled", self._readColor(parser, sec, "disabled"))
# Palette
sec = "Palette"
@@ -344,6 +349,7 @@ class GuiTheme:
self._setPalette(parser, sec, "highlightedtext", QPalette.ColorRole.HighlightedText)
self._setPalette(parser, sec, "link", QPalette.ColorRole.Link)
self._setPalette(parser, sec, "linkvisited", QPalette.ColorRole.LinkVisited)
self.accentCol = self._readColor(parser, sec, "accent") # Special handling 'til Qt 6.6
# GUI
sec = "GUI"
@@ -427,8 +433,8 @@ class GuiTheme:
self._guiPalette.setBrush(QtColDisabled, QPalette.ColorRole.Highlight, grey)
if CONFIG.verQtValue >= 0x060600:
self._guiPalette.setBrush(QtColActive, QPalette.ColorRole.Accent, highlight)
self._guiPalette.setBrush(QtColInactive, QPalette.ColorRole.Accent, highlight)
self._guiPalette.setBrush(QtColActive, QPalette.ColorRole.Accent, self.accentCol)
self._guiPalette.setBrush(QtColInactive, QPalette.ColorRole.Accent, self.accentCol)
self._guiPalette.setBrush(QtColDisabled, QPalette.ColorRole.Accent, grey)
# Set project override colours
@@ -506,6 +512,7 @@ class GuiTheme:
isDark = self.isDesktopDarkMode()
# Reset GUI Palette
base = palette.color(QPalette.ColorRole.Base)
default = palette.color(QPalette.ColorRole.Text)
faded = QColor(128, 128, 128)
dimmed = QColor(130, 130, 130) if isDark else QColor(190, 190, 190)
@@ -528,6 +535,7 @@ class GuiTheme:
self.iconCache.clear()
self._svgColors = {}
self._qColors = {}
self._setBaseColor("base", base)
self._setBaseColor("default", default)
self._setBaseColor("faded", faded)
self._setBaseColor("red", red)
@@ -544,6 +552,9 @@ class GuiTheme:
self._setBaseColor("chapter", red)
self._setBaseColor("scene", blue)
self._setBaseColor("note", yellow)
self._setBaseColor("active", green)
self._setBaseColor("inactive", red)
self._setBaseColor("disabled", faded)
return
+4 -3
View File
@@ -616,16 +616,17 @@ def testGuiTheme_CheckTheme(theme):
"name", "mode", # The rest are not required
],
"Base": [
"default", "faded", "red", "orange", "yellow", "green", "cyan",
"blue", "purple",
"base", "default", "faded", "red", "orange", "yellow", "green",
"cyan", "blue", "purple",
],
"Project": [
"root", "folder", "file", "title", "chapter", "scene", "note",
"active", "inactive", "disabled",
],
"Palette": [
"window", "windowtext", "base", "alternatebase", "text",
"tooltipbase", "tooltiptext", "button", "buttontext", "brighttext",
"highlight", "highlightedtext", "link", "linkvisited",
"highlight", "highlightedtext", "link", "linkvisited", "accent",
],
"GUI": [
"helptext", "fadedtext", "errortext",