Add syntax colour for whitespace (#2548)

This commit is contained in:
Veronica Berglyd Olsen
2025-10-26 12:52:08 +01:00
committed by GitHub
73 changed files with 83 additions and 11 deletions
+5 -3
View File
@@ -109,6 +109,7 @@ A colour theme ``.conf`` file consists of the following settings:
headertext = green
headertag = green:L135
emphasis = orange
whitespace = orange:64
dialog = blue
altdialog = red
note = yellow:D125
@@ -173,9 +174,10 @@ There are several ways to enter colour values:
.. versionadded:: 2.8
The ``[Syntax]`` section was moved into the main theme file. Previously, these settings were in
their own file. The ``[Icons]`` section was renamed to ``[Base]``. Added the ``line`` setting.
Dropped the ``license``, ``licenseurl``, and ``description`` settings. The ``author`` field
is now required if the theme is included in the app, but not for user themes.
their own file. The ``[Icons]`` section was renamed to ``[Base]``. Added the ``line`` and
``whitespace`` settings. Dropped the ``license``, ``licenseurl``, and ``description`` settings.
The ``author`` field is now required if the theme is included in the app, but not for user
themes.
Icon Themes
+1
View File
@@ -59,6 +59,7 @@ link = blue
headertext = cyan
headertag = cyan:128
emphasis = purple:L105
whitespace = purple:64
dialog = cyan
altdialog = blue
note = yellow
@@ -57,6 +57,7 @@ link = blue
headertext = cyan
headertag = cyan:128
emphasis = purple
whitespace = purple:64
dialog = cyan:D105
altdialog = blue
note = yellow
+1
View File
@@ -59,6 +59,7 @@ link = blue
headertext = cyan
headertag = cyan:128
emphasis = #a581ec
whitespace = #a581ec64
dialog = cyan
altdialog = blue
note = yellow
@@ -59,6 +59,7 @@ link = blue
headertext = #fbfaf8
headertag = #828782
emphasis = #3fac39
whitespace = #3fac3964
dialog = #90d98c
altdialog = #4cb946
note = #dd843c
@@ -59,6 +59,7 @@ link = blue
headertext = #2b2c2a
headertag = #828782
emphasis = #4cb946
whitespace = #4cb94664
dialog = #1c8217
altdialog = #3fac39
note = #d97726
@@ -59,6 +59,7 @@ link = blue
headertext = red
headertag = red:128
emphasis = #ffffff
whitespace = #ffffff64
dialog = #fe81b5
altdialog = #ffb3d2
note = #a0acfe
@@ -59,6 +59,7 @@ link = blue
headertext = red
headertag = red:128
emphasis = #1e202f
whitespace = #1e202f64
dialog = red
altdialog = #fb6fa9
note = blue
@@ -59,6 +59,7 @@ link = blue
headertext = cyan
headertag = cyan:128
emphasis = #5fe2d1
whitespace = #5fe2d164
dialog = #87B4FC
altdialog = #5A96F6
note = #d19af4
@@ -59,6 +59,7 @@ link = blue
headertext = cyan
headertag = cyan:128
emphasis = #008976
whitespace = #00897664
dialog = #1a68e5
altdialog = #1249a0
note = #c17eed
@@ -59,6 +59,7 @@ link = blue
headertext = red
headertag = red:128
emphasis = #f391b6
whitespace = #f391b664
dialog = yellow
altdialog = #e86296
note = #929ff7
@@ -59,6 +59,7 @@ link = blue
headertext = red
headertag = red:128
emphasis = #d53874
whitespace = #d5387464
dialog = #9f6303
altdialog = #e86296
note = blue
@@ -59,6 +59,7 @@ link = blue
headertext = blue
headertag = blue:D150
emphasis = blue:L150
whitespace = blue:64
dialog = blue
altdialog = blue:L150
note = blue:L150
@@ -59,6 +59,7 @@ link = blue
headertext = blue
headertag = blue:D150
emphasis = blue:L125
whitespace = blue:64
dialog = blue
altdialog = blue:L125
note = blue:L125
@@ -57,6 +57,7 @@ link = blue
headertext = yellow
headertag = yellow:160
emphasis = #aa791e
whitespace = #aa791e64
dialog = green:D110
altdialog = #378b8b
note = faded
@@ -57,6 +57,7 @@ link = blue
headertext = yellow
headertag = yellow:160
emphasis = yellow
whitespace = yellow:64
dialog = green
altdialog = cyan
note = faded
@@ -57,6 +57,7 @@ link = blue
headertext = red
headertag = red:128
emphasis = #488843
whitespace = #48884364
dialog = #b95a00
altdialog = #b18010
note = faded
+1
View File
@@ -57,6 +57,7 @@ link = blue
headertext = red
headertag = red:128
emphasis = #85c47f
whitespace = #85c47f64
dialog = orange
altdialog = yellow
note = faded
@@ -58,6 +58,7 @@ link = blue
headertext = #ffffff
headertag = purple
emphasis = cyan
whitespace = cyan:64
dialog = green
altdialog = #008cff
note = #969696
@@ -59,6 +59,7 @@ link = blue
headertext = green
headertag = green:D150
emphasis = orange
whitespace = orange:64
dialog = blue
altdialog = red
note = yellow
@@ -59,6 +59,7 @@ link = blue
headertext = green
headertag = green:L135
emphasis = orange
whitespace = orange:64
dialog = blue
altdialog = red
note = yellow:D125
+1
View File
@@ -75,6 +75,7 @@ link = #ff79c6
headertext = purple
headertag = purple:D150
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = #ffcce9
+1
View File
@@ -59,6 +59,7 @@ link = blue
headertext = yellow:L125
headertag = faded
emphasis = orange
whitespace = orange:64
dialog = yellow
altdialog = orange
note = yellow:L125
@@ -59,6 +59,7 @@ link = blue
headertext = cyan
headertag = cyan:128
emphasis = blue
whitespace = blue:64
dialog = green
altdialog = cyan
note = purple
@@ -59,6 +59,7 @@ link = blue
headertext = cyan
headertag = cyan:128
emphasis = blue
whitespace = blue:64
dialog = green
altdialog = cyan
note = purple
@@ -57,6 +57,7 @@ link = #4781d8
headertext = #4781d8
headertag = #4781d880
emphasis = #8152b8
whitespace = #8152b864
dialog = #eb4073
altdialog = #4781d8
note = #31924c
@@ -57,6 +57,7 @@ link = blue
headertext = blue
headertag = blue:128
emphasis = #ff9dd9
whitespace = #ff9dd964
dialog = #d19df3
altdialog = blue
note = #65ca80
+1
View File
@@ -57,6 +57,7 @@ link = blue
headertext = purple
headertag = purple:128
emphasis = blue
whitespace = blue:64
dialog = #0e2a35
altdialog = cyan
note = green
+1
View File
@@ -59,6 +59,7 @@ link = default
headertext = default:L115
headertag = default:D125
emphasis = default
whitespace = default:64
dialog = default
altdialog = default
note = default
@@ -59,6 +59,7 @@ link = default
headertext = default:D200
headertag = default:L400
emphasis = default
whitespace = default:64
dialog = default
altdialog = default
note = default
@@ -59,6 +59,7 @@ link = blue
headertext = red
headertag = red:128
emphasis = yellow
whitespace = yellow:64
dialog = orange
altdialog = red
note = blue
@@ -59,6 +59,7 @@ link = blue
headertext = red
headertag = red:128
emphasis = #f6661e
whitespace = #f6661e64
dialog = orange
altdialog = red
note = blue
+1
View File
@@ -59,6 +59,7 @@ link = purple
headertext = orange
headertag = red
emphasis = orange
whitespace = orange:64
dialog = yellow
altdialog = green
note = purple
+1
View File
@@ -79,6 +79,7 @@ link = blue
headertext = blue
headertag = blue:160
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = yellow:D175
+1
View File
@@ -59,6 +59,7 @@ link = blue
headertext = purple
headertag = purple:128
emphasis = blue
whitespace = blue:64
dialog = #ffffff
altdialog = cyan
note = green
+1
View File
@@ -79,6 +79,7 @@ link = blue
headertext = blue
headertag = blue:160
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = yellow:L115
+1
View File
@@ -91,6 +91,7 @@ link = #40d4e7
headertext = #49e9a6
headertag = green:D125
emphasis = #d67e5c
whitespace = #d67e5c64
dialog = green
altdialog = blue
note = #d67e5c
@@ -91,6 +91,7 @@ link = #00c6e0
headertext = #00b368
headertag = green:D125
emphasis = #b3694d
whitespace = #b3694d64
dialog = green
altdialog = blue
note = #b3694d
+1
View File
@@ -59,6 +59,7 @@ link = purple
headertext = cyan
headertag = cyan:128
emphasis = #8fbcbb
whitespace = #8fbcbb64
dialog = blue
altdialog = green
note = orange
+1
View File
@@ -57,6 +57,7 @@ link = purple
headertext = #559db1
headertag = #559db188
emphasis = #549b86
whitespace = #549b8664
dialog = #5579a5
altdialog = #619b5b
note = orange
@@ -57,6 +57,7 @@ link = #a6d0ed
headertext = yellow
headertag = yellow:128
emphasis = yellow
whitespace = yellow:64
dialog = green
altdialog = orange
note = #a6d0ed
@@ -57,6 +57,7 @@ link = blue
headertext = yellow
headertag = yellow:128
emphasis = #ad802a
whitespace = #ad802a64
dialog = green
altdialog = #c0652d
note = #668bbd
+1
View File
@@ -58,6 +58,7 @@ link = green
headertext = green
headertag = green:128
emphasis = #99bbff
whitespace = #99bbff64
dialog = cyan
altdialog = green
note = #c7b377
@@ -59,6 +59,7 @@ link = blue
headertext = default
headertag = #9ea7b0
emphasis = #1a7f37
whitespace = #1a7f3764
dialog = #0d1117
altdialog = cyan
note = #bf8700
@@ -59,6 +59,7 @@ link = blue
headertext = default
headertag = #b1bac4
emphasis = #7ee787
whitespace = #7ee78764
dialog = #ffffff
altdialog = #57ccc5
note = #f8e3a1
+1
View File
@@ -57,6 +57,7 @@ link = #5159cc
headertext = #343242
headertag = #34324280
emphasis = #c05858
whitespace = #c0585864
dialog = #ce1d1d
altdialog = #c45522
note = #9f58ad
+2 -1
View File
@@ -57,6 +57,7 @@ link = blue
headertext = default
headertag = default:128
emphasis = #ff9d9d
whitespace = #ff9d9d64
dialog = red
altdialog = orange
note = purple
@@ -70,4 +71,4 @@ spellcheckline = #ff2727
errorline = cyan
replacetag = blue
modifier = green
texthighlight = red:80
texthighlight = red:80
@@ -57,6 +57,7 @@ link = blue
headertext = #e4e0ec
headertag = faded
emphasis = #9267d3
whitespace = #9267d364
dialog = #e4e0ec
altdialog = #c458ac
note = red
@@ -57,6 +57,7 @@ link = blue
headertext = #29252f
headertag = faded
emphasis = purple
whitespace = purple:64
dialog = #29252f
altdialog = #c458ac
note = red
@@ -57,6 +57,7 @@ link = cyan
headertext = default
headertag = default:160
emphasis = #f1daca
whitespace = #f1daca64
dialog = orange
altdialog = red
note = green
@@ -57,6 +57,7 @@ link = #458871
headertext = default
headertag = default:160
emphasis = #6e2920
whitespace = #6e292064
dialog = #ac5828
altdialog = #b44b4b
note = #6e8021
+1
View File
@@ -72,6 +72,7 @@ link = blue
headertext = green
headertag = green:D125
emphasis = purple
whitespace = purple:64
dialog = blue
altdialog = yellow
note = cyan
@@ -78,6 +78,7 @@ link = blue
headertext = blue
headertag = #657b83
emphasis = blue
whitespace = blue:64
dialog = cyan
altdialog = red
note = cyan:D125
@@ -78,6 +78,7 @@ link = blue
headertext = blue
headertag = #657b83
emphasis = blue
whitespace = blue:64
dialog = cyan
altdialog = red
note = cyan:D125
@@ -57,6 +57,7 @@ link = #5577bb
headertext = #66515e
headertag = #66515e80
emphasis = #5577bb
whitespace = #5577bb64
dialog = #c54a5f
altdialog = #4d968a
note = #699128
@@ -57,6 +57,7 @@ link = blue
headertext = #f3eae0
headertag = #f3eae080
emphasis = blue
whitespace = blue:64
dialog = red
altdialog = cyan
note = green
@@ -73,6 +73,7 @@ link = blue
headertext = blue
headertag = blue:160
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = yellow:L115
@@ -73,6 +73,7 @@ link = blue
headertext = blue
headertag = blue:160
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = yellow:D125
+1
View File
@@ -79,6 +79,7 @@ link = blue
headertext = blue
headertag = blue:L135
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = #b38c00
@@ -79,6 +79,7 @@ link = blue
headertext = blue
headertag = blue:D150
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = #f0dbb2
@@ -79,6 +79,7 @@ link = blue
headertext = blue
headertag = blue:D150
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = #fff4cc
@@ -79,6 +79,7 @@ link = blue
headertext = blue
headertag = blue:D150
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = #e7d696
@@ -79,6 +79,7 @@ link = blue
headertext = blue
headertag = blue:D150
emphasis = orange
whitespace = orange:64
dialog = green
altdialog = yellow
note = #ffe6b3
@@ -59,6 +59,7 @@ link = blue
headertext = cyan
headertag = cyan:128
emphasis = blue
whitespace = blue:64
dialog = green
altdialog = cyan
note = red
@@ -59,6 +59,7 @@ link = blue
headertext = yellow
headertag = yellow:128
emphasis = orange
whitespace = orange:64
dialog = red
altdialog = yellow
note = green
@@ -72,4 +73,4 @@ spellcheckline = #ff3737
errorline = cyan
replacetag = #ff61e5
modifier = cyan
texthighlight = red:80
texthighlight = red:80
@@ -59,6 +59,7 @@ link = blue
headertext = cyan
headertag = cyan:128
emphasis = blue
whitespace = blue:64
dialog = green
altdialog = cyan
note = red
@@ -59,6 +59,7 @@ link = blue
headertext = yellow
headertag = yellow:128
emphasis = orange
whitespace = orange:64
dialog = red
altdialog = #a37e03
note = green
+1
View File
@@ -58,6 +58,7 @@ link = green
headertext = green
headertag = green:128
emphasis = #fff6aa
whitespace = #fff6aa64
dialog = cyan
altdialog = #11bdc6
note = green
@@ -57,6 +57,7 @@ link = blue
headertext = default
headertag = faded
emphasis = green
whitespace = green:64
dialog = #ff9fbd
altdialog = orange
note = blue
@@ -57,6 +57,7 @@ link = #0b9caf
headertext = #526b5d
headertag = #526b5d80
emphasis = #1e920e
whitespace = #1e920e64
dialog = #d15574
altdialog = #d86f3e
note = #0b9caf
+1 -3
View File
@@ -94,8 +94,6 @@ class GuiDocHighlighter(QSyntaxHighlighter):
syntax = SHARED.theme.syntaxTheme
colEmph = syntax.emph if CONFIG.highlightEmph else None
colBreak = QColor(syntax.emph)
colBreak.setAlpha(64)
# Create Character Formats
self._addCharFormat("text", syntax.text)
@@ -112,7 +110,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
self._addCharFormat("strike", syntax.hidden, "s")
self._addCharFormat("mark", syntax.mark, "bg")
self._addCharFormat("mspaces", syntax.error, "err")
self._addCharFormat("nobreak", colBreak, "bg")
self._addCharFormat("nobreak", syntax.space, "bg")
self._addCharFormat("altdialog", syntax.dialA)
self._addCharFormat("dialog", syntax.dialN)
self._addCharFormat("replace", syntax.repTag)
+2
View File
@@ -114,6 +114,7 @@ class SyntaxColors:
head: QColor = QColor(0, 0, 0)
headH: QColor = QColor(0, 0, 0)
emph: QColor = QColor(0, 0, 0)
space: QColor = QColor(0, 0, 0)
dialN: QColor = QColor(0, 0, 0)
dialA: QColor = QColor(0, 0, 0)
hidden: QColor = QColor(0, 0, 0)
@@ -393,6 +394,7 @@ class GuiTheme:
self.syntaxTheme.head = self._readColor(parser, sec, "headertext")
self.syntaxTheme.headH = self._readColor(parser, sec, "headertag")
self.syntaxTheme.emph = self._readColor(parser, sec, "emphasis")
self.syntaxTheme.space = self._readColor(parser, sec, "whitespace")
self.syntaxTheme.dialN = self._readColor(parser, sec, "dialog")
self.syntaxTheme.dialA = self._readColor(parser, sec, "altdialog")
self.syntaxTheme.hidden = self._readColor(parser, sec, "hidden")
+4 -3
View File
@@ -635,9 +635,10 @@ def testGuiTheme_CheckTheme(theme):
],
"Syntax": [
"background", "text", "line", "link", "headertext", "headertag",
"emphasis", "dialog", "altdialog", "hidden", "note", "shortcode",
"keyword", "tag", "value", "optional", "spellcheckline",
"errorline", "replacetag", "modifier", "texthighlight",
"emphasis", "whitespace", "dialog", "altdialog", "hidden", "note",
"shortcode", "keyword", "tag", "value", "optional",
"spellcheckline", "errorline", "replacetag", "modifier",
"texthighlight",
],
}
optional = ["credit", "url"]