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

uiSlider value box font properties won't update when changed #68

Closed
damiensellier opened this issue Feb 12, 2025 · 3 comments
Closed

uiSlider value box font properties won't update when changed #68

damiensellier opened this issue Feb 12, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@damiensellier
Copy link
Owner

damiensellier commented Feb 12, 2025

REF : RomanKubiak#703 (reply in thread)

Font properties updating are missing from when Ctrlr was updated to JUCE v6.

I'll check how it was working in the 5.3.198 version, I have the code source somewhere for reference.

Those parameters should apply from this line of code :

else if (property == Ids::uiSliderIncDecButtonColour

 else if (property == Ids::uiSliderIncDecButtonColour
             || property == Ids::uiSliderIncDecTextColour
             || property == Ids::uiSliderValueFont
             || property == Ids::uiSliderValueTextJustification)
    {
        
        if ( getProperty(Ids::uiSliderLookAndFeel) == "V3"
            || getProperty(Ids::uiSliderLookAndFeel) == "V2"
            || getProperty(Ids::uiSliderLookAndFeel) == "V1" )
        {
            ctrlrSlider.setLookAndFeel (nullptr); // Warning, it resets the LnF on loading
            ctrlrSlider.setLookAndFeel (&lf); // V5.6.28 and before
        }
        else
        {
            //ctrlrSlider.setLookAndFeel (nullptr); // Warning, it resets the LnF on loading
            //ctrlrSlider.setLookAndFeel (&lfV4); // V5.6.28+
        }
        setProperty(Ids::uiSliderLookAndFeelIsCustom, true); // Locks the component custom colourScheme
    }

But I don't remember exactly, there was a tricky part about the slider being able to be updated right away but the box with the values not... those being actually 2 different components.

@damiensellier damiensellier added the bug Something isn't working label Feb 12, 2025
@damiensellier damiensellier self-assigned this Feb 12, 2025
@damiensellier
Copy link
Owner Author

Please first separate all those properties such as :

else if (property == Ids::uiSliderValueFont)
    {
        
        if ( getProperty(Ids::uiSliderLookAndFeel) == "V3"
            || getProperty(Ids::uiSliderLookAndFeel) == "V2"
            || getProperty(Ids::uiSliderLookAndFeel) == "V1" )
        {
            ctrlrSlider.setLookAndFeel (nullptr); // Warning, it resets the LnF on loading
            ctrlrSlider.setLookAndFeel (&lf); // V5.6.28 and before
        }
        else
        {
            ctrlrSlider.setLookAndFeel (nullptr); // Warning, it resets the LnF on loading
            ctrlrSlider.setLookAndFeel (&lfV4); // V5.6.28+
        }
        setProperty(Ids::uiSliderLookAndFeelIsCustom, true); // Locks the component custom colourScheme
    }

else if (property == Ids::uiSliderValueTextJustification)
    {
        
        if ( getProperty(Ids::uiSliderLookAndFeel) == "V3"
            || getProperty(Ids::uiSliderLookAndFeel) == "V2"
            || getProperty(Ids::uiSliderLookAndFeel) == "V1" )
        {
            ctrlrSlider.setLookAndFeel (nullptr); // Warning, it resets the LnF on loading
            ctrlrSlider.setLookAndFeel (&lf); // V5.6.28 and before
        }
        else
        {
            ctrlrSlider.setLookAndFeel (nullptr); // Warning, it resets the LnF on loading
            ctrlrSlider.setLookAndFeel (&lfV4); // V5.6.28+
        }
        setProperty(Ids::uiSliderLookAndFeelIsCustom, true); // Locks the component custom colourScheme
    }

etc

@damiensellier
Copy link
Owner Author

damiensellier commented Feb 12, 2025

COPY the method for uiSliderValueFont as for uiSliderValueTextColour

    else if (property == Ids::uiSliderValueTextColour)
    {
        ctrlrSlider.setColour (Slider::textBoxTextColourId, VAR2COLOUR(getProperty (Ids::uiSliderValueTextColour)) );
        setProperty(Ids::uiSliderLookAndFeelIsCustom, true); // Locks the component custom colourScheme
    }

AND don't forget to add the text properties in the function resetLookAndFeelOverrides() at the right place.

@damiensellier
Copy link
Owner Author

FIXED on 18/02/25 for v5.6.32

    else if (property == Ids::uiSliderIncDecButtonColour
             || property == Ids::uiSliderIncDecTextColour
             || property == Ids::uiSliderValueFont
             || property == Ids::uiSliderValueTextJustification)
    {
        
        if ( getProperty(Ids::uiSliderLookAndFeel) == "V3"
            || getProperty(Ids::uiSliderLookAndFeel) == "V2"
            || getProperty(Ids::uiSliderLookAndFeel) == "V1" )
        {
            ctrlrSlider.setLookAndFeel (nullptr); // Warning, it resets the LnF on loading
            ctrlrSlider.setLookAndFeel (&lf); // V5.6.28 and before
        }
        else
        {
            ctrlrSlider.setLookAndFeel (nullptr); // Warning, it resets the LnF on loading. Uncommented v5.6.32
            ctrlrSlider.setLookAndFeel (&lfV4); // V5.6.28+. Uncommented v5.6.32
        }
        setProperty(Ids::uiSliderLookAndFeelIsCustom, true); // Locks the component custom colourScheme
        ctrlrSlider.lookAndFeelChanged(); // Added v5.6.32
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant