Merge branch 'main' into espresso_theme
This commit is contained in:
@@ -55,8 +55,6 @@ A colour theme ``.conf`` file consists of the following settings:
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Veronica Berglyd Olsen
|
||||
url = https://github.com/vkbo/novelWriter
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Base]
|
||||
base = #fcfcfc
|
||||
@@ -140,7 +138,7 @@ affects.
|
||||
:header: "Section", "Description"
|
||||
:class: "tight-table"
|
||||
|
||||
"``[Main]``", "Meta data about the theme, You must at least set ``name`` and ``mode``, and ``mode`` must be either ``light`` or ``dark``."
|
||||
"``[Main]``", "Meta data about the theme, You must at least set ``name``, ``mode`` and ``author``, and ``mode`` must be either ``light`` or ``dark``."
|
||||
"``[Base]``", "The base colours of the theme. These are also selectable colours in various places inside the app, like for icon colours in **Preferences**."
|
||||
"``[Project]``", "The colours used for icons and markers for the different project item types."
|
||||
"``[Palette]``", "The colours used for styling the user interface. The values correspond to the ColorRole_ values in the Qt library."
|
||||
@@ -177,6 +175,8 @@ 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`` and ``licenseurl`` settings. The ``description`` and ``author`` fields
|
||||
are now required if the theme is included in the app, but not for user themes.
|
||||
|
||||
|
||||
Icon Themes
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Blue Streak Dark
|
||||
mode = dark
|
||||
description = A theme mainly using shades of blue
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Veronica Berglyd Olsen
|
||||
url = https://github.com/vkbo/novelWriter
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Base]
|
||||
base = #2d2d2d
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Blue Streak Light
|
||||
mode = light
|
||||
description = A theme mainly using shades of blue
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Veronica Berglyd Olsen
|
||||
url = https://github.com/vkbo/novelWriter
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Base]
|
||||
base = #fcfcfc
|
||||
|
||||
@@ -4,8 +4,6 @@ mode = dark
|
||||
description = A taste of the future 80s
|
||||
author = Anders Lemvigh
|
||||
url = https://github.com/alemvigh
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Base]
|
||||
base = #000000
|
||||
|
||||
@@ -5,8 +5,6 @@ description = The novelWriter standard dark theme
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Veronica Berglyd Olsen
|
||||
url = https://github.com/vkbo/novelWriter
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Base]
|
||||
base = #373737
|
||||
@@ -63,7 +61,7 @@ headertext = green
|
||||
headertag = green:D150
|
||||
emphasis = orange
|
||||
dialog = blue
|
||||
altdialog = blue
|
||||
altdialog = red
|
||||
note = yellow
|
||||
hidden = faded
|
||||
shortcode = green
|
||||
|
||||
@@ -5,8 +5,6 @@ description = The novelWriter standard light theme
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Veronica Berglyd Olsen
|
||||
url = https://github.com/vkbo/novelWriter
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Base]
|
||||
base = #fcfcfc
|
||||
@@ -63,7 +61,7 @@ headertext = green
|
||||
headertag = green:L135
|
||||
emphasis = orange
|
||||
dialog = blue
|
||||
altdialog = blue
|
||||
altdialog = red
|
||||
note = yellow:D125
|
||||
hidden = faded
|
||||
shortcode = green
|
||||
|
||||
@@ -5,8 +5,6 @@ description = A dark theme with bright colours
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
credit = Zeno Rocha
|
||||
url = https://draculatheme.com
|
||||
license = MIT
|
||||
licenseurl = https://github.com/dracula/dracula-theme/blob/main/LICENSE
|
||||
|
||||
##
|
||||
# Colours:
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Grey Dark
|
||||
mode = dark
|
||||
description = A theme with minimal colours
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Veronica Berglyd Olsen
|
||||
url = https://github.com/vkbo/novelWriter
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Base]
|
||||
base = #3e3e3e
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Grey Light
|
||||
mode = light
|
||||
description = A theme with minimal colours
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Veronica Berglyd Olsen
|
||||
url = https://github.com/vkbo/novelWriter
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Base]
|
||||
base = #ffffff
|
||||
|
||||
@@ -3,10 +3,8 @@ name = LCARS
|
||||
mode = dark
|
||||
description = The Next Generation of Star Trek colours
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Veronica Berglyd Olsen
|
||||
credit = Star Trek TNG
|
||||
url = https://github.com/vkbo/novelWriter
|
||||
license = CC BY-SA 4.0
|
||||
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
[Base]
|
||||
base = #101010
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Light Owl
|
||||
mode = light
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
credit = Sarah Drasner (color theme)
|
||||
description = A theme for the night owls out there, but for daylight
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Sarah Drasner
|
||||
url = https://github.com/sdras/night-owl-vscode-theme
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/sdras/night-owl-vscode-theme/blob/master/LICENSE
|
||||
|
||||
##
|
||||
# Theme: Light Owl
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Night Owl
|
||||
mode = dark
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
credit = Sarah Drasner (color theme)
|
||||
description = A theme for the night owls out there
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Sarah Drasner
|
||||
url = https://github.com/sdras/night-owl-vscode-theme
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/sdras/night-owl-vscode-theme/blob/master/LICENSE
|
||||
|
||||
##
|
||||
# Theme: Night Owl
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Primer Light
|
||||
mode = light
|
||||
author = Myian (adaptation)
|
||||
description = Primer
|
||||
author = Myian
|
||||
credit = GitHub Inc.
|
||||
url = https://github.com/primer
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/primer/brand/blob/main/LICENSE
|
||||
|
||||
[Base]
|
||||
base = #ffffff
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Primer Night
|
||||
mode = dark
|
||||
author = Myian (adaptation)
|
||||
description = Primer
|
||||
author = Myian
|
||||
credit = GitHub Inc.
|
||||
url = https://github.com/primer
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/primer/brand/blob/main/LICENSE
|
||||
|
||||
[Base]
|
||||
base = #0d1117
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Snazzy Light
|
||||
mode = light
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
credit = Florian Reuschel (color theme)
|
||||
description = A vivid light color theme
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Florian Reuschel, Sindre Sorhus
|
||||
url = https://github.com/loilo/vscode-snazzy-light
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/loilo/vscode-snazzy-light/blob/master/LICENSE
|
||||
|
||||
##
|
||||
# Colours:
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Solarized Dark
|
||||
mode = dark
|
||||
author = nullbasis
|
||||
description = Precision colors for machines and people
|
||||
author = nullbasis, Veronica Berglyd Olsen
|
||||
credit = Ethan Schoonover
|
||||
url = https://ethanschoonover.com/solarized/
|
||||
license = MIT
|
||||
licenseurl = https://github.com/altercation/solarized/blob/master/LICENSE
|
||||
|
||||
##
|
||||
# base03: #002b36
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Solarized Light
|
||||
mode = light
|
||||
author = nullbasis
|
||||
description = Precision colors for machines and people
|
||||
author = nullbasis, Veronica Berglyd Olsen
|
||||
credit = Ethan Schoonover
|
||||
url = https://ethanschoonover.com/solarized/
|
||||
license = MIT
|
||||
licenseurl = https://github.com/altercation/solarized/blob/master/LICENSE
|
||||
|
||||
##
|
||||
# base03: #002b36
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
[Main]
|
||||
name = Tango Dark
|
||||
mode = dark
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
description = Colors for everyone
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Tango Desktop Project
|
||||
url = https://en.wikipedia.org/wiki/Tango_Desktop_Project
|
||||
|
||||
##
|
||||
# Colours:
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
[Main]
|
||||
name = Tango Light
|
||||
mode = light
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
description = Colors for everyone
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Tango Desktop Project
|
||||
url = https://en.wikipedia.org/wiki/Tango_Desktop_Project
|
||||
|
||||
##
|
||||
# Colours:
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Tomorrow
|
||||
mode = light
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
credit = Chris Kempson (color theme)
|
||||
description = A colourful theme with muted colours and sensible highlighting
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Chris Kempson
|
||||
url = https://github.com/chriskempson/tomorrow-theme
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.md
|
||||
|
||||
##
|
||||
# Theme: Tomorrow
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Tomorrow Night
|
||||
mode = dark
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
credit = Chris Kempson (color theme)
|
||||
description = A colourful theme with muted colours and sensible highlighting
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Chris Kempson
|
||||
url = https://github.com/chriskempson/tomorrow-theme
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.md
|
||||
|
||||
##
|
||||
# Theme: Tomorrow Night
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Tomorrow Night Blue
|
||||
mode = dark
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
credit = Chris Kempson (color theme)
|
||||
description = A colourful theme with muted colours and sensible highlighting
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Chris Kempson
|
||||
url = https://github.com/chriskempson/tomorrow-theme
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.md
|
||||
|
||||
##
|
||||
# Theme: Tomorrow Night Blue
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Tomorrow Night Bright
|
||||
mode = dark
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
credit = Chris Kempson (color theme)
|
||||
description = A colourful theme with muted colours and sensible highlighting
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Chris Kempson
|
||||
url = https://github.com/chriskempson/tomorrow-theme
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.md
|
||||
|
||||
##
|
||||
# Theme: Tomorrow Night Bright
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[Main]
|
||||
name = Tomorrow Night Eighties
|
||||
mode = dark
|
||||
author = Veronica Berglyd Olsen (adaptation)
|
||||
credit = Chris Kempson (color theme)
|
||||
description = A colourful theme with muted colours and sensible highlighting
|
||||
author = Veronica Berglyd Olsen
|
||||
credit = Chris Kempson
|
||||
url = https://github.com/chriskempson/tomorrow-theme
|
||||
license = MIT License
|
||||
licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.md
|
||||
|
||||
##
|
||||
# Theme: Tomorrow Night Eighties
|
||||
|
||||
+14
-11
@@ -72,8 +72,13 @@ class ThemeMeta:
|
||||
author: str = ""
|
||||
credit: str = ""
|
||||
url: str = ""
|
||||
|
||||
|
||||
class IconsMeta:
|
||||
|
||||
name: str = ""
|
||||
author: str = ""
|
||||
license: str = ""
|
||||
licenseUrl: str = ""
|
||||
|
||||
|
||||
class SyntaxColors:
|
||||
@@ -296,12 +301,10 @@ class GuiTheme:
|
||||
if parser.has_section(sec):
|
||||
meta.name = parser.get(sec, "name", fallback="")
|
||||
meta.mode = parser.get(sec, "mode", fallback="light")
|
||||
meta.description = parser.get(sec, "description", fallback="N/A")
|
||||
meta.author = parser.get(sec, "author", fallback="N/A")
|
||||
meta.credit = parser.get(sec, "credit", fallback="N/A")
|
||||
meta.description = parser.get(sec, "description", fallback="")
|
||||
meta.author = parser.get(sec, "author", fallback="")
|
||||
meta.credit = parser.get(sec, "credit", fallback="")
|
||||
meta.url = parser.get(sec, "url", fallback="")
|
||||
meta.license = parser.get(sec, "license", fallback="N/A")
|
||||
meta.licenseUrl = parser.get(sec, "licenseurl", fallback="")
|
||||
|
||||
self._meta = meta
|
||||
|
||||
@@ -613,13 +616,13 @@ class GuiTheme:
|
||||
parser.clear()
|
||||
parser.read(file, encoding="utf-8")
|
||||
name = parser.get("Main", "name", fallback="")
|
||||
dark = parser.get("Main", "mode", fallback="light").lower() == "dark"
|
||||
if name:
|
||||
mode = parser.get("Main", "mode", fallback="").lower()
|
||||
if name and mode in ("light", "dark"):
|
||||
key = file.stem
|
||||
prefix = "*" if key.startswith("default") else ""
|
||||
lookup = f"{prefix}{name} {key}"
|
||||
keys.append(lookup)
|
||||
data[lookup] = (file.stem, name, dark, file)
|
||||
data[lookup] = (file.stem, name, mode == "dark", file)
|
||||
except Exception: # noqa: PERF203
|
||||
logger.error("Could not read file: %s", file)
|
||||
logException()
|
||||
@@ -659,7 +662,7 @@ class GuiIcons:
|
||||
def __init__(self, mainTheme: GuiTheme) -> None:
|
||||
|
||||
self._theme = mainTheme
|
||||
self._meta = ThemeMeta()
|
||||
self._meta = IconsMeta()
|
||||
|
||||
# Storage
|
||||
self._allThemes: dict[str, ThemeEntry] = {}
|
||||
@@ -722,7 +725,7 @@ class GuiIcons:
|
||||
CONFIG.splashMessage(f"Loading icon theme: {entry.name}")
|
||||
logger.info("Loading icon theme '%s'", theme)
|
||||
try:
|
||||
meta = ThemeMeta()
|
||||
meta = IconsMeta()
|
||||
with open(entry.path, mode="r", encoding="utf-8") as icons:
|
||||
for icon in icons:
|
||||
bits = icon.partition("=")
|
||||
|
||||
@@ -613,7 +613,7 @@ def testGuiTheme_CheckTheme(theme):
|
||||
|
||||
structure = {
|
||||
"Main": [
|
||||
"name", "mode", # The rest are not required
|
||||
"name", "mode", "description", "author", # The rest are not required
|
||||
],
|
||||
"Base": [
|
||||
"base", "default", "faded", "red", "orange", "yellow", "green",
|
||||
@@ -638,7 +638,7 @@ def testGuiTheme_CheckTheme(theme):
|
||||
"errorline", "replacetag", "modifier", "texthighlight",
|
||||
],
|
||||
}
|
||||
optional = ["description", "author", "credit", "url", "license", "licenseurl"]
|
||||
optional = ["credit", "url"]
|
||||
missing = []
|
||||
for section, options in structure.items():
|
||||
missing.extend(opt for opt in options if opt not in parser[section])
|
||||
|
||||
Reference in New Issue
Block a user