-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[IDE] Add support for selectable, user-defined and pre-packaged themes contained in zip files #7124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IDE] Add support for selectable, user-defined and pre-packaged themes contained in zip files #7124
Conversation
Fixes arduino#6350 (the regression was introduced with b2241da ) Thanks git-bisect :)
Thanks @kurtgo for the hint Solves arduino#6832
User testing on skilled devs showed that "buttons appear on click" behaviour is far from being understood. Accessibility features (like moving with Arrow keys) should be untouched.
Reloads sketch content if the Editor is not in foreground and isomething happens in the backing storage files. Note that no confirmation dialog is displayed (same behaviour as SublimeText, differs from other IDEs) Fixes arduino#4551 and arduino#5345
In case of low inotify watch level, simply avoid doing anything. Backing storage will be uncorrelated with the sketch content (as before) TODO: maybe add a notification about this event
This ensures that watcher is inactive when children views are focused Solves arduino#6827
The HTML view only activates if: - the output is steady - the "frame" contains a link - the length of the entire content is < 1KB No performance penalty compared to normal view (in standard conditions)
Implemented using a dry run to get the metrics and the needed shift Fixes arduino#1193 and arduino#6109
tested with Marlin Firmware, solves arduino#6109 arduino#3601 arduino#1193
By threading the boardChange callback we can busy wait until the compilation/upload phase has ended and change the board when done. Fixes arduino#6035
Was causing NPE on certain cores
Solves arduino#7097; the user will be prompted if default sketchbook folder doesn't exist. If needed, the exception will be thrown by getDefaultSketchbookFolder() as in Linux/OSX implementations.
[IDE] Add support for user-defined theme in sketchbook folder
@ArduinoBot build this please |
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-7124-BUILD-738-linux32.tar.xz ℹ️ The |
Tested on macOS High Sierra, version 10.13.2, works fine as far as I can tell. |
3317e84
to
9907376
Compare
Am I okay to close this PR since it seems like the changes were merged into the beta branch, github just hasn't autoclosed it. |
Ah, yes, due to the rebase every information about the actual PR got lost but the commit is merged. Closing, thank you! |
Summary
As mentioned in #7115, this PR adds support for selectable, user-defined themes packaged in zip files. This is intended to make it easier for users to share their themes with others.
Description
This PR adds the following features:
Much like the previous PR, user-defined themes can be installed in a
theme
folder within the user's sketchbook folder. However unlike resources placed directly in thetheme
folder, zip-packaged themes are not automatically activated in the IDE. Instead, available theme zips are enumerated at startup (and when opening the preferences dialog) and can be selected via the preferences dialog.Zips are selected for candidacy if they contain a
theme.txt
, though thetheme.txt
itself can be empty if the theme only overrides other resources such as images.Zips can optionally contain a
theme.properties
file which is a standard Java properties file which currently supports the following keys:name
can be used to specify a display name for the theme (used in the properties dialog)version
can be used to specify a version stringDefining a standard properties file makes it easy to add additional functionality in the future, such as defining supported IDE version ranges for a theme, update URLs, author information, etc. to be determined as required.
Zip resources override default resources, but can themselves be overridden by resources placed in the
theme
folder directly. This means there's a simple heirarchy of selection for resources with user-defined resources being highest, zip-packaged resources next, and default resources being lowest.In addition to the
<sketchbook>/theme
folder, the defaulttheme
folder in the application directory is also scanned for zipped themes. This is intended to make it possible for the IDE to package some additional selectable themes in the standard distribution, for example high contrast theme for visually impaired, dark theme, etc.If the same theme file exists in both locations, the user can select either one. Selected file names are prefixed with a "namespace" when stored in the
preferences.txt
which determines the location of the file.Screenshots
This PR adds a single entry to the preferences dialog, which allows the theme to be selected:
Notes
I have only tested this functionality on Windows and Linux because I don't have access to a Mac computer. Accessing resources in the zip is achieved by compiling a URL which points to the file within the zip, the same URL format as used by the JRE for resources within jars. This should hopefully be fully supported across platforms (I already took care of the mangling required for windows paths) but may need some quick checking on a Mac just be sure.
This PR alters the external contract of
Theme
to return aResource
instead of aFile
when a file is needed directly. SinceResource
instances are aware of resources they override (via theirgetParent()
method), future consumers can leverage the "supercedes" relationship of theme resources if they wish. An example of this is already provided in theloadFromResource
convenience method provided forPreferencesMap
, whereby the preferences are loaded "bottom up" allowing preferences in higher priority resources to override those specified by lower priority ones.Any changes or comments just let me know.