Browse Source

DemoRunner: Avoid hiding UI behind virtual keyboard

v7.0.9
reuk 3 years ago
parent
commit
09c107698b
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
2 changed files with 8 additions and 1 deletions
  1. +7
    -0
      examples/DemoRunner/Source/Main.cpp
  2. +1
    -1
      examples/DemoRunner/Source/UI/MainComponent.cpp

+ 7
- 0
examples/DemoRunner/Source/Main.cpp 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()); }


+ 1
- 1
examples/DemoRunner/Source/UI/MainComponent.cpp 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;
}();


Loading…
Cancel
Save