diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-20 08:33:15 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-20 08:33:15 +0200 |
commit | 0c4fc5d9189510ff88369709f018afc550aa0b54 (patch) | |
tree | 88f743ca8e6ab22e8eea781d116cdfc34c8b91d0 /src/ui/util.c | |
parent | c1cc59ee6a6d8b88d6f49eb59ffa871d75c75866 (diff) |
iOS: Tweaks and changes for phone mode
Phone mode uses a modified user interface. Work in progress...
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 20 |
1 files changed, 15 insertions, 5 deletions
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. */ | |||
37 | #include "text.h" | 37 | #include "text.h" |
38 | #include "window.h" | 38 | #include "window.h" |
39 | 39 | ||
40 | #if defined (iPlatformAppleMobile) | ||
41 | # include "../ios.h" | ||
42 | #endif | ||
43 | |||
40 | #include <the_Foundation/math.h> | 44 | #include <the_Foundation/math.h> |
41 | #include <the_Foundation/path.h> | 45 | #include <the_Foundation/path.h> |
42 | #include <SDL_timer.h> | 46 | #include <SDL_timer.h> |
@@ -472,13 +476,19 @@ void openMenu_Widget(iWidget *d, iInt2 coord) { | |||
472 | } | 476 | } |
473 | #endif | 477 | #endif |
474 | const iRect bounds = bounds_Widget(d); | 478 | const iRect bounds = bounds_Widget(d); |
475 | const int leftExcess = -left_Rect(bounds); | 479 | int leftExcess = -left_Rect(bounds); |
476 | const int rightExcess = right_Rect(bounds) - rootSize.x; | 480 | int rightExcess = right_Rect(bounds) - rootSize.x; |
477 | int topExcess = -top_Rect(bounds); | 481 | int topExcess = -top_Rect(bounds); |
478 | const int bottomExcess = bottom_Rect(bounds) - rootSize.y; | 482 | int bottomExcess = bottom_Rect(bounds) - rootSize.y; |
479 | #if defined (iPlatformAppleMobile) | 483 | #if defined (iPlatformAppleMobile) |
480 | /* Reserve space for the system status bar. */ | 484 | /* Reserve space for the system status bar. */ { |
481 | topExcess += 4.5 * gap_UI; | 485 | float l, t, r, b; |
486 | safeAreaInsets_iOS(&l, &t, &r, &b); | ||
487 | topExcess += t; | ||
488 | bottomExcess += b; | ||
489 | leftExcess += l; | ||
490 | rightExcess += r; | ||
491 | } | ||
482 | #endif | 492 | #endif |
483 | if (bottomExcess > 0) { | 493 | if (bottomExcess > 0) { |
484 | d->rect.pos.y -= bottomExcess; | 494 | d->rect.pos.y -= bottomExcess; |