diff --git a/Common/UI/Context.cpp b/Common/UI/Context.cpp index 26eeb831b7..88a165d1f3 100644 --- a/Common/UI/Context.cpp +++ b/Common/UI/Context.cpp @@ -164,11 +164,18 @@ Bounds UIContext::GetLayoutBounds(ViewLayoutMode layoutMode, bool immersiveMode) break; } + // The side insets are only evened out in landscape. In portrait, a camera cutout is at the top, so a + // side inset is a real edge (like the sensor bar on the iPhone Duo's cover screen) and stays as is. + const Bounds screenBounds = GetBounds(); + const bool landscape = screenBounds.w > screenBounds.h; + if (immersiveMode) { if (!hasCameraCutout) { // No cutout, so if the nav bar is hidden, we can use the full width of the screen. left = 0.0f; right = 0.0f; + } else if (!landscape) { + // Keep the insets. } else if (left > 0 && right > 0) { // Navigation bar is available, so insets leave space for it // even if it's hidden. @@ -181,7 +188,7 @@ Bounds UIContext::GetLayoutBounds(ViewLayoutMode layoutMode, bool immersiveMode) right = sideWidth; } } else { - if ((left > 0) != (right > 0)) { + if (landscape && (left > 0) != (right > 0)) { // Only one side has a cutout (surely the camera, which is usually smaller than the nav bar), so use the larger of the two for both sides. int sideWidth = std::max(left, right); left = sideWidth;