1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-14 00:14:18 +00:00

Fix for auto-toggle DrawableButtons not updating their image immediately.

This commit is contained in:
jules 2013-10-12 15:44:31 +01:00
parent a7df25f860
commit 2cded82ea6
2 changed files with 4 additions and 3 deletions

View file

@ -308,7 +308,7 @@ void Button::triggerClick()
void Button::internalClickCallback (const ModifierKeys& modifiers)
{
if (clickTogglesState)
setToggleState ((radioGroupId != 0) || ! lastToggleState, dontSendNotification);
setToggleState (radioGroupId != 0 || ! lastToggleState, sendNotification);
sendClickMessage (modifiers);
}

View file

@ -214,7 +214,8 @@ Drawable* DrawableButton::getOverImage() const noexcept
Drawable* DrawableButton::getDownImage() const noexcept
{
Drawable* const d = getToggleState() ? downImageOn : downImage;
if (Drawable* const d = getToggleState() ? downImageOn : downImage)
return d;
return d != nullptr ? d : getOverImage();
return getOverImage();
}