mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Made sure that CalloutBoxes disappear when clicking on another app.
This commit is contained in:
parent
d2d32e1abf
commit
530dca28a5
1 changed files with 12 additions and 4 deletions
|
|
@ -48,8 +48,11 @@ CallOutBox::~CallOutBox()
|
|||
{
|
||||
}
|
||||
|
||||
enum { callOutBoxDismissCommandId = 0x4f83a04b };
|
||||
|
||||
//==============================================================================
|
||||
class CallOutBoxCallback : public ModalComponentManager::Callback
|
||||
class CallOutBoxCallback : public ModalComponentManager::Callback,
|
||||
private Timer
|
||||
{
|
||||
public:
|
||||
CallOutBoxCallback (Component* c, const Rectangle<int>& area, Component* parent)
|
||||
|
|
@ -57,9 +60,16 @@ public:
|
|||
{
|
||||
callout.setVisible (true);
|
||||
callout.enterModalState (true, this);
|
||||
startTimer (200);
|
||||
}
|
||||
|
||||
void modalStateFinished (int) {}
|
||||
void modalStateFinished (int) override {}
|
||||
|
||||
void timerCallback() override
|
||||
{
|
||||
if (! Process::isForegroundProcess())
|
||||
callout.postCommandMessage (callOutBoxDismissCommandId);
|
||||
}
|
||||
|
||||
ScopedPointer<Component> content;
|
||||
CallOutBox callout;
|
||||
|
|
@ -110,8 +120,6 @@ bool CallOutBox::hitTest (int x, int y)
|
|||
return outline.contains ((float) x, (float) y);
|
||||
}
|
||||
|
||||
enum { callOutBoxDismissCommandId = 0x4f83a04b };
|
||||
|
||||
void CallOutBox::inputAttemptWhenModal()
|
||||
{
|
||||
const Point<int> mousePos (getMouseXYRelative() + getBounds().getPosition());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue