Browse Source

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

tags/2021-05-28
jules 11 years ago
parent
commit
2cded82ea6
2 changed files with 4 additions and 3 deletions
  1. +1
    -1
      modules/juce_gui_basics/buttons/juce_Button.cpp
  2. +3
    -2
      modules/juce_gui_basics/buttons/juce_DrawableButton.cpp

+ 1
- 1
modules/juce_gui_basics/buttons/juce_Button.cpp 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);
}


+ 3
- 2
modules/juce_gui_basics/buttons/juce_DrawableButton.cpp 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();
}

Loading…
Cancel
Save