arduino-ide
arduino-ide copied to clipboard
feat: icon for cloud sketch in File > Open Recent
Depends on #1833
Motivation
As asked for in #1826, IDE2 would like to show an icon for cloud sketches in File > Open Recent.
This is just the infrastructure and an example of how IDE2 can render a custom image for a menu item. The images are missing from the PR. Here is the documentation of supported native image formats. If IDE2 wants to dispatch images on the selected theme, I am happy to update the PR.

Source of my example cloud image: https://imagensemoldes.com.br/wp-content/uploads/2020/04/%C3%8Dcone-Computador-Nuvem-PNG.png
Change description
- Dedicated static folder on the IDE2 backed to host the images,
- Exposed endpoint from IDE2 backend to load the image as a binary,
- IDE2 frontend fetches the image content and builds a
nativeImage
. - A cloud icon is rendered in the native menu item if the sketch is inside
directories.data/RemoteSketchbook
.
Other information
Ref: #1826
Reviewer checklist
- [ ] PR addresses a single concern.
- [ ] The PR has no duplicates (please search among the Pull Requests before creating one)
- [ ] PR title and description are properly filled.
- [ ] Docs have been added / updated (for bug fixes / features)
@kittaakos is this pending a design decision? Thanks
If IDE2 wants to dispatch images on the selected theme
@kittaakos is this pending a design decision? Thanks
@davegarthsimpson, yes.
@kittaakos the icon looks great. -> if is possible to make the icons theme dependent would be great. Tell me if you need assets for that. -> If is not feasible to have it in time for our next release, for now we can adopt the same solution of the titlebar, with "Cloud" textual prefix.
wdyt?
-> if is possible to make the icons theme dependent would be great. Tell me if you need assets for that.
Yes, IDE2 needs the icons if the feature is required. Please see the PR description with the electron restrictions on the icon.
-> If is not feasible to have it in time for our next release,
I am not in the loop, I do not even know when does the next release happen.
If IDE2 wants to dispatch images on the selected theme
Dispatching the icon based on IDE2's theme is not the best idea. The OS native menu is still dark, although the IDE2's theme is light. Please decide, @91volt. Thanks!
In-action:
https://user-images.githubusercontent.com/1405703/228169326-4559a6b3-bef2-4d17-a221-265d546e0113.mp4
Dispatching the icon based on IDE2's theme is not the best idea.
Another approach could be using the nativeTheme
from Electron.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
Akos Kitta seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.