From 0c4fc5d9189510ff88369709f018afc550aa0b54 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 20 Feb 2021 08:33:15 +0200 Subject: iOS: Tweaks and changes for phone mode Phone mode uses a modified user interface. Work in progress... --- src/ui/util.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/ui/util.c') diff --git a/src/ui/util.c b/src/ui/util.c index 850ca818..1ff1b7f7 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -37,6 +37,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "text.h" #include "window.h" +#if defined (iPlatformAppleMobile) +# include "../ios.h" +#endif + #include #include #include @@ -472,13 +476,19 @@ void openMenu_Widget(iWidget *d, iInt2 coord) { } #endif const iRect bounds = bounds_Widget(d); - const int leftExcess = -left_Rect(bounds); - const int rightExcess = right_Rect(bounds) - rootSize.x; + int leftExcess = -left_Rect(bounds); + int rightExcess = right_Rect(bounds) - rootSize.x; int topExcess = -top_Rect(bounds); - const int bottomExcess = bottom_Rect(bounds) - rootSize.y; + int bottomExcess = bottom_Rect(bounds) - rootSize.y; #if defined (iPlatformAppleMobile) - /* Reserve space for the system status bar. */ - topExcess += 4.5 * gap_UI; + /* Reserve space for the system status bar. */ { + float l, t, r, b; + safeAreaInsets_iOS(&l, &t, &r, &b); + topExcess += t; + bottomExcess += b; + leftExcess += l; + rightExcess += r; + } #endif if (bottomExcess > 0) { d->rect.pos.y -= bottomExcess; -- cgit v1.2.3