The caller of Theme.getThemeImage(...) now pass only the name of
the needed resource and the theme folder is searche in the following
order:
- name.svg
- name.png (if svg is not available)
- name@2x.png (if none of the above are available or if 1x png is
too low resolution for the current scaling factor)
Hi-resolution images are saved with the "@2x.png" suffix, the image
loader will select the best image available based on the user selected
scaling.
Missing hi-res images can be added later together with lo-res images.
This allows the use-case with users editing one sketch at a time, that
seems to be the most common scenario:
1. User position the editor as desired
2. User close the IDE
3. User opens the IDE by double clicking on another .ino file
4. The IDE is opened again at the same position
See #4432
The check for "resolution-changed" is performed when an editor
location is retrieved from preferences. This commit rationalize
access to PreferencesData and prepares for the next improvement.
This rationalization helps to better follow the swing abstractions
of table models and increase separation of concerns.
(WIP: ContributedPlatforms needs a similar refactoring that will be
done in the next commits)
When a sketch has unsaved changes, a temporary copy of the sketch is
made with those changes applied. This copy is then passed to
arduino-builder.
Previously, the name of this directory contained a hash of the main
sketch filename, so the same directory would be used between builds. Now
that this directory is deleted after every build, it can just use a
randomized directory name, which is what this commit does.
Addtionally, the prefix used for generating the name is changed from
"arduino_" to "arduino_modified_sketch_" to make it slightly clearer
what the directory is for (just in case it somehow survives the build,
or a user sees it during the build).