Browse Source

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

tags/2021-05-28
jules 12 years ago
parent
commit
ff0fd27127
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      modules/juce_gui_basics/buttons/juce_Button.cpp

+ 10
- 3
modules/juce_gui_basics/buttons/juce_Button.cpp 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 (shouldBeOn != getToggleState())
{
setToggleState (shouldBeOn, sendNotification);
return;
}
}
if (radioGroupId != 0 || ! clickTogglesState)
sendClickMessage (modifiers);
sendClickMessage (modifiers);
}
void Button::flashButtonState()


Loading…
Cancel
Save