1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

DemoRunner: Avoid hiding UI behind virtual keyboard

This commit is contained in:
reuk 2022-07-13 18:19:07 +01:00
parent 8cab4cf5bb
commit 09c107698b
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
2 changed files with 8 additions and 1 deletions

View file

@ -153,6 +153,13 @@ private:
void closeButtonPressed() override { JUCEApplication::getInstance()->systemRequestedQuit(); }
#if JUCE_IOS || JUCE_ANDROID
void parentSizeChanged() override
{
getMainComponent().resized();
}
#endif
//==============================================================================
MainComponent& getMainComponent() { return *dynamic_cast<MainComponent*> (getContentComponent()); }

View file

@ -358,7 +358,7 @@ void MainComponent::resized()
auto bounds = getLocalBounds();
if (auto* display = Desktop::getInstance().getDisplays().getDisplayForRect (getScreenBounds()))
return display->safeAreaInsets.subtractedFrom (bounds);
return display->safeAreaInsets.subtractedFrom (display->keyboardInsets.subtractedFrom (bounds));
return bounds;
}();