From b744308198bc821db9e0ed5801b75740289ab385 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 8 Dec 2021 17:12:57 +0200 Subject: iOS: Fixed safe area inset issues --- src/ui/mobile.c | 2 +- src/ui/root.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui/mobile.c b/src/ui/mobile.c index fdcc4248..5a787e7b 100644 --- a/src/ui/mobile.c +++ b/src/ui/mobile.c @@ -156,7 +156,7 @@ static iBool mainDetailSplitHandler_(iWidget *mainDetailSplit, const char *cmd) if (isSideBySide) { setVisualOffset_Widget(panel, 0, 0, 0); } - setPadding_Widget(panel, pad, 0, pad, pad); + setPadding_Widget(panel, pad, 0, pad, pad + bottomSafeInset_Mobile()); } arrange_Widget(mainDetailSplit); updateCertListHeight_(detailStack); diff --git a/src/ui/root.c b/src/ui/root.c index 2a7bf4ff..08e0eafd 100644 --- a/src/ui/root.c +++ b/src/ui/root.c @@ -1698,9 +1698,10 @@ iRect safeRect_Root(const iRoot *d) { iRect visibleRect_Root(const iRoot *d) { iRect visRect = rect_Root(d); + float bottom = 0.0f; #if defined (iPlatformAppleMobile) /* TODO: Check this on device... Maybe DisplayUsableBounds would be good here, too? */ - float left, top, right, bottom; + float left, top, right; safeAreaInsets_iOS(&left, &top, &right, &bottom); visRect.pos.x = (int) left; visRect.size.x -= (int) (left + right); @@ -1725,6 +1726,6 @@ iRect visibleRect_Root(const iRoot *d) { visRect = intersect_Rect(visRect, init_Rect(usable.x, usable.y, usable.w, usable.h)); } #endif - adjustEdges_Rect(&visRect, 0, 0, -get_MainWindow()->keyboardHeight, 0); + adjustEdges_Rect(&visRect, 0, 0, -get_MainWindow()->keyboardHeight + bottom, 0); return visRect; } -- cgit v1.2.3