Drawable Button Image States


#1

I think there might have been a change recently in the DrawableButton code so that the images don’t get updated correctly when set to toggle. Eg. if you set the background colours to red for off and green for on then a similar thing with 2 drawables:

db->setImages (&normal, &normal, &normal, &normal, &down, &down, &down, &down); // or should do the same thing db->setImages (&normal, 0, 0, 0, &down); db->setClickingTogglesState (true); db->setBackgroundColours (Colours::red, Colours::green);

When you click the button the background colour will change but the image will stay the same until you mouse out of the component.

The image will change however if you click on the button for a second time which means your images are in a different state to the background. If like me you are using inverted colours for the backgrounds and images your image will basically disappear until you mouse out.

That code above is straight from the juce demo if you wanted to see it in action.


#2

Thanks! Looks like an easy fix, I’ll sort that out in my next check-in…