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

Yet another attempt to get all the edge-cases right in Button::internalClickCallback

This commit is contained in:
jules 2013-11-07 10:19:58 +00:00
parent e9598bb5c5
commit ff0fd27127

View file

@ -308,10 +308,17 @@ void Button::triggerClick()
void Button::internalClickCallback (const ModifierKeys& modifiers)
{
if (clickTogglesState)
setToggleState (radioGroupId != 0 || ! lastToggleState, sendNotification);
{
const bool shouldBeOn = (radioGroupId != 0 || ! lastToggleState);
if (radioGroupId != 0 || ! clickTogglesState)
sendClickMessage (modifiers);
if (shouldBeOn != getToggleState())
{
setToggleState (shouldBeOn, sendNotification);
return;
}
}
sendClickMessage (modifiers);
}
void Button::flashButtonState()