summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-08 17:12:57 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-08 17:12:57 +0200
commitb744308198bc821db9e0ed5801b75740289ab385 (patch)
tree82f7ac28e487a06f8ab1a9a4dedb7de558c2de58
parentfde64385b7cf0a51e471112ce80e6b2d81540e08 (diff)
iOS: Fixed safe area inset issues
-rw-r--r--src/ui/mobile.c2
-rw-r--r--src/ui/root.c5
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)
156 if (isSideBySide) { 156 if (isSideBySide) {
157 setVisualOffset_Widget(panel, 0, 0, 0); 157 setVisualOffset_Widget(panel, 0, 0, 0);
158 } 158 }
159 setPadding_Widget(panel, pad, 0, pad, pad); 159 setPadding_Widget(panel, pad, 0, pad, pad + bottomSafeInset_Mobile());
160 } 160 }
161 arrange_Widget(mainDetailSplit); 161 arrange_Widget(mainDetailSplit);
162 updateCertListHeight_(detailStack); 162 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) {
1698 1698
1699iRect visibleRect_Root(const iRoot *d) { 1699iRect visibleRect_Root(const iRoot *d) {
1700 iRect visRect = rect_Root(d); 1700 iRect visRect = rect_Root(d);
1701 float bottom = 0.0f;
1701#if defined (iPlatformAppleMobile) 1702#if defined (iPlatformAppleMobile)
1702 /* TODO: Check this on device... Maybe DisplayUsableBounds would be good here, too? */ 1703 /* TODO: Check this on device... Maybe DisplayUsableBounds would be good here, too? */
1703 float left, top, right, bottom; 1704 float left, top, right;
1704 safeAreaInsets_iOS(&left, &top, &right, &bottom); 1705 safeAreaInsets_iOS(&left, &top, &right, &bottom);
1705 visRect.pos.x = (int) left; 1706 visRect.pos.x = (int) left;
1706 visRect.size.x -= (int) (left + right); 1707 visRect.size.x -= (int) (left + right);
@@ -1725,6 +1726,6 @@ iRect visibleRect_Root(const iRoot *d) {
1725 visRect = intersect_Rect(visRect, init_Rect(usable.x, usable.y, usable.w, usable.h)); 1726 visRect = intersect_Rect(visRect, init_Rect(usable.x, usable.y, usable.w, usable.h));
1726 } 1727 }
1727#endif 1728#endif
1728 adjustEdges_Rect(&visRect, 0, 0, -get_MainWindow()->keyboardHeight, 0); 1729 adjustEdges_Rect(&visRect, 0, 0, -get_MainWindow()->keyboardHeight + bottom, 0);
1729 return visRect; 1730 return visRect;
1730} 1731}