[SUGGESTION] CalloutBox should handle QUIT when visible

Currently on JUCE 7.0.12 (and I expect on JUCE 8 as well) in a JUCE app if you have a CallOutBox open you have to first dismiss it to be able to quit…

Can you please add a lambda to CallOutBox:

std::function<void()> onQuit;

and in the code add:

bool CallOutBox::keyPressed (const KeyPress& key)
{
    if (key.isKeyCode (KeyPress::escapeKey))
    {
        inputAttemptWhenModal();
        return true;
    }
    
#if JUCE_MAC
    
    if (key.isKeyCode ('Q') && key.getModifiers().isCommandDown())              // Command + Q
        {
        NullCheckedInvocation::invoke (onQuit);
        }
    
#endif
    
#if JUCE_WINDOWS
    
    if (key.isKeyCode (KeyPress::F4Key) && key.getModifiers().isAltDown())      // Alt + F4
        {
        NullCheckedInvocation::invoke (onQuit);
        }
    
#endif

#if JUCE_LINUX
    
    if (key.isKeyCode ('Q') && key.getModifiers().isCtrlDown())                 // CTRL + Q
        {
        NullCheckedInvocation::invoke (onQuit);
        }
    
#endif
    
    return false;
}

Thanks,

Rail