From cccb2960505e2d8fd8a3292727cfbc7b2e016d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 25 Oct 2026 23:21:12 +0100 Subject: [PATCH] UI: Only even out the side insets in landscape In portrait, a camera cutout is at the top, so a one-sided side inset is a real edge and mirroring it just wastes space. The iPhone Duo's cover screen has its sensor bar on the right in portrait, which left an equally wide empty strip on the left of the main screen. Co-Authored-By: Claude Opus 5.5 (1M context) --- Common/UI/Context.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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;