Skip to content

Commit

Permalink
Projucer: Made login form overlay modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ed95 committed May 20, 2021
1 parent 185b1b3 commit 4849b9f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions extras/Projucer/Source/Application/jucer_MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class BlurOverlayWithComponent : public Component,

static_cast<Component&> (mainWindow).addChildComponent (this);
componentMovedOrResized (true, true);

enterModalState();
}

void resized() override
Expand All @@ -67,6 +69,11 @@ class BlurOverlayWithComponent : public Component,
g.drawImage (componentImage, getLocalBounds().toFloat());
}

void inputAttemptWhenModal() override
{
mainWindow.hideLoginFormOverlay();
}

private:
void componentPeerChanged() override {}

Expand All @@ -92,7 +99,8 @@ class BlurOverlayWithComponent : public Component,

void refreshBackgroundImage()
{
setVisible (false);
setAlwaysOnTop (false);
toBack();

auto parentBounds = mainWindow.getBounds();

Expand All @@ -102,7 +110,8 @@ class BlurOverlayWithComponent : public Component,

kernel.applyToImage (componentImage, componentImage, getLocalBounds());

setVisible (true);
setAlwaysOnTop (true);
toFront (true);
}

//==============================================================================
Expand Down Expand Up @@ -479,10 +488,6 @@ void MainWindow::showLoginFormOverlay()
{
blurOverlayComponent = std::make_unique<BlurOverlayWithComponent> (*this, std::make_unique<LoginFormComponent> (*this));
loginFormOpen = true;

if (auto* loginForm = blurOverlayComponent->getChildComponent (0))
if (auto* handler = loginForm->getAccessibilityHandler())
handler->grabFocus();
}

void MainWindow::hideLoginFormOverlay()
Expand Down

0 comments on commit 4849b9f

Please sign in to comment.