diff options
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 553d9078..850ca818 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -463,12 +463,23 @@ void openMenu_Widget(iWidget *d, iInt2 coord) { | |||
463 | arrange_Widget(d); | 463 | arrange_Widget(d); |
464 | d->rect.pos = coord; | 464 | d->rect.pos = coord; |
465 | /* Ensure the full menu is visible. */ | 465 | /* Ensure the full menu is visible. */ |
466 | const iInt2 rootSize = rootSize_Window(get_Window()); | 466 | const iInt2 rootSize = rootSize_Window(get_Window()); |
467 | #if defined (iPlatformAppleMobile) | ||
468 | /* Move out from under the user's hand/finger. */ | ||
469 | if (!parentMenuButton_(d)) { | ||
470 | const float normX = (float) left_Rect(bounds_Widget(d)) / rootSize.x; | ||
471 | subv_I2(&d->rect.pos, init_I2(normX * width_Rect(d->rect), height_Rect(d->rect))); | ||
472 | } | ||
473 | #endif | ||
467 | const iRect bounds = bounds_Widget(d); | 474 | const iRect bounds = bounds_Widget(d); |
468 | const int leftExcess = -left_Rect(bounds); | 475 | const int leftExcess = -left_Rect(bounds); |
469 | const int rightExcess = right_Rect(bounds) - rootSize.x; | 476 | const int rightExcess = right_Rect(bounds) - rootSize.x; |
470 | const int topExcess = -top_Rect(bounds); | 477 | int topExcess = -top_Rect(bounds); |
471 | const int bottomExcess = bottom_Rect(bounds) - rootSize.y; | 478 | const int bottomExcess = bottom_Rect(bounds) - rootSize.y; |
479 | #if defined (iPlatformAppleMobile) | ||
480 | /* Reserve space for the system status bar. */ | ||
481 | topExcess += 4.5 * gap_UI; | ||
482 | #endif | ||
472 | if (bottomExcess > 0) { | 483 | if (bottomExcess > 0) { |
473 | d->rect.pos.y -= bottomExcess; | 484 | d->rect.pos.y -= bottomExcess; |
474 | } | 485 | } |