[IDE] Add support for user-defined theme in sketchbook folder #7115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request provides a small enhancement to the way themes are handled within the IDE, providing support for a user-defined
theme
folder placed in the sketchbook folder to override elements in the internaltheme
folder.Description
This small change provides the following features:
<sketchbook>/theme/theme.zip
. I'd be happy to add this if there's any interest.).svg
first and.png
otherwise. This PR preserves this relationship within a theme type, but a.png
resource in a user-defined theme can still override an.svg
resource in the default theme.lib
folder directly are first checked in the user-defined theme folder,editor.font
property if a user-defined theme wishes to customise the font, however the custom font is not applied if the user has already defined a non-standard font in theirpreferences.txt
. This is intended so that third-party theme designers can specify an editor font as part of their theme but previous user preferences will still take precedence.Examples
Installing this dark theme can be achieved by downloading or cloning the repo and simply placing the
theme
folder inside the arduino sketch folder:Simple customisations can be applied on top of the default theme by creating a
theme.txt
with only the required customised settings. For example this barebonestheme.txt
:Results in the following customised theme output:
This is intended to provide users with a simple way to customise only a few theme elements (eg. comment colour) without needing to take a kitchen sink approach or have to continually re-apply their specific settings when upgrading to new versions of the IDE.
Notes
master
for integration in 1.8.6 then I'm happy to do that, though I assumed that since this is a mainly cosmetic piece of functionality that the beta would be a more sensible target.Thanks for your time and consideration.