Skip to content
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

corrections for DexedTheme v2 #443

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

FulopNandor
Copy link
Contributor

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:

  1. Because the dexed-pipeline failed yesterday in the case of build-macos due to the deprecation of forEachXmlChildElementWithTagName(), I have replaced it by for-loop based on juce::XmlElement::getFirstChildElement() as initialization and juce::XmlElement::getFirstChildElement() as iteration.
  2. I have introduced a method replaceImage() instead of the findImage(). Its reason is that findImage() returns nullptr in that case when DexedTheme.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 the DexedTheme.xml for the Light_28x28.png˛, e.g.
    <image id="Light_28x28.png" path="nonExsitentSubdirectory/Or/MissingPicture.png"/>
    then all the LEDs disappear from the GUI:
    nonexistent_LED_file
    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 in DexedTheme.xml, the original content of the proper image variable
will not be overwritten, so the default red LEDs are displayed:
default_LED_file
Or, if the new image file exists, e.g. GreenLight_28x28.png in the relative path myTheme/, 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:
existing_LED_file
Thank you in advance! (hoping that all the checks will be passed now...)

@asb2m10 asb2m10 merged commit 2a2f880 into asb2m10:master Jul 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants