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:
parent
e9598bb5c5
commit
ff0fd27127
1 changed files with 10 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue