summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 4607b44c..a85c8a29 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -498,15 +498,21 @@ static void checkLoadAnimation_Window_(iWindow *d) {
498 498
499static void updatePadding_Window_(iWindow *d) { 499static void updatePadding_Window_(iWindow *d) {
500#if defined (iPlatformAppleMobile) 500#if defined (iPlatformAppleMobile)
501 iWidget *toolBar = findChild_Widget(d->root, "toolbar");
502 float left, top, right, bottom;
503 safeAreaInsets_iOS(&left, &top, &right, &bottom);
501 /* Respect the safe area insets. */ { 504 /* Respect the safe area insets. */ {
502 float left, top, right, bottom;
503 safeAreaInsets_iOS(&left, &top, &right, &bottom);
504 setPadding_Widget(findChild_Widget(d->root, "navdiv"), left, top, right, 0); 505 setPadding_Widget(findChild_Widget(d->root, "navdiv"), left, top, right, 0);
505 iWidget *toolBar = findChild_Widget(d->root, "toolbar");
506 if (toolBar) { 506 if (toolBar) {
507 setPadding_Widget(toolBar, left, 0, right, bottom); 507 setPadding_Widget(toolBar, left, 0, right, bottom);
508 } 508 }
509 } 509 }
510 if (toolBar) {
511 iWidget *sidebar = findChild_Widget(d->root, "sidebar");
512 setPadding_Widget(sidebar, 0, 0, 0, isPortrait_App() ? 11 * gap_UI + bottom : 0);
513 /* TODO: There seems to be unrelated layout glitch in the sidebar where its children
514 are not arranged correctly until it's hidden and reshown. */
515 }
510 /* Note that `handleNavBarCommands_` also adjusts padding and spacing. */ 516 /* Note that `handleNavBarCommands_` also adjusts padding and spacing. */
511#endif 517#endif
512} 518}
@@ -1253,6 +1259,7 @@ static void updateRootSize_Window_(iWindow *d, iBool notifyAlways) {
1253 size->y -= d->keyboardHeight; 1259 size->y -= d->keyboardHeight;
1254 d->root->minSize = *size; 1260 d->root->minSize = *size;
1255 if (notifyAlways || !isEqual_I2(oldSize, *size)) { 1261 if (notifyAlways || !isEqual_I2(oldSize, *size)) {
1262 updatePadding_Window_(d);
1256 const iBool isHoriz = (d->place.lastNotifiedSize.x != size->x); 1263 const iBool isHoriz = (d->place.lastNotifiedSize.x != size->x);
1257 const iBool isVert = (d->place.lastNotifiedSize.y != size->y); 1264 const iBool isVert = (d->place.lastNotifiedSize.y != size->y);
1258 arrange_Widget(d->root); 1265 arrange_Widget(d->root);
@@ -1903,7 +1910,6 @@ void draw_Window(iWindow *d) {
1903 iInt2 renderSize; 1910 iInt2 renderSize;
1904 SDL_GetRendererOutputSize(d->render, &renderSize.x, &renderSize.y); 1911 SDL_GetRendererOutputSize(d->render, &renderSize.x, &renderSize.y);
1905 if (!isEqual_I2(renderSize, d->root->rect.size)) { 1912 if (!isEqual_I2(renderSize, d->root->rect.size)) {
1906 updatePadding_Window_(d);
1907 updateRootSize_Window_(d, iTrue); 1913 updateRootSize_Window_(d, iTrue);
1908 processEvents_App(postedEventsOnly_AppEventMode); 1914 processEvents_App(postedEventsOnly_AppEventMode);
1909 } 1915 }