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.
Dear Pascal,
Please, accept my current pull request, which contains modifications in
DXLookNFeel.cpp
.In comparison the related part of its former PR there are the following differences:
build-macos
due to the deprecation offorEachXmlChildElementWithTagName()
, I have replaced it byfor
-loop based onjuce::XmlElement::getFirstChildElement()
as initialization andjuce::XmlElement::getFirstChildElement()
as iteration.replaceImage()
instead of thefindImage()
. Its reason is thatfindImage()
returnsnullptr
in that case whenDexedTheme.xml
refers to a nonexistent image (or the loading of the given image is failed by some other reason). At this point,nullptr
will be stored in the corresponding image variable, which results in nothing being displayed on the screen instead of the associated component. For instance, if we specify a broken path in theDexedTheme.xml
for theLight_28x28.png˛
, e.g.<image id="Light_28x28.png" path="nonExsitentSubdirectory/Or/MissingPicture.png"/>
then all the LEDs disappear from the GUI:
despite that the proper image variable was initialized to the image of a red LED before.
The new method
replaceImage()
updates the image variable with the new image only if the loading of the new image was successful. So, when a nonexistent image is specified inDexedTheme.xml
, the original content of the proper image variablewill not be overwritten, so the default red LEDs are displayed:
Or, if the new image file exists, e.g.
GreenLight_28x28.png
in the relative pathmyTheme/
, and was loaded successfully due to line<image id="Light_28x28.png" path="myTheme/GreenLight_28x28.png"/>
in
DexedTheme.xml
, then its content (green color LED, in this example) are displayed:Thank you in advance! (hoping that all the checks will be passed now...)