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.
This might be somewhat of a controversial way to do this, because of the complexity and RAM, but I think
caching is useful, because embedded devices should be able to run for decades without issues, and it's only 5kb for a full screen jpg. I don't know what the read disturb effect is like on the M5Stack.
It might be worth getting rid of caching, but that wouldn't be too hard.
Editable textboxes need the background color highlight behind the words, so it looks a little odd, but should still work. No noticeable performance hit despite re-rendering the jpg all the time.
The theme option is background_img, and SD cards and SPIFFS filenames are both supported(Selected by filename, either starting with /spiffs/ or /sd/). I've also got fallback code to use the solid color background if the file is missing.
In the process, I've also abstracted out the "drawBackground" function, which draws a patch of whatever the current background is.