diff options
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index e13f8da9..b6f9298c 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -503,7 +503,7 @@ static iRect documentBounds_DocumentWidget_(const iDocumentWidget *d) { | |||
503 | rect.size.y -= margin; | 503 | rect.size.y -= margin; |
504 | } | 504 | } |
505 | if (d->flags & centerVertically_DocumentWidgetFlag) { | 505 | if (d->flags & centerVertically_DocumentWidgetFlag) { |
506 | const iInt2 docSize = size_GmDocument(d->doc); | 506 | const iInt2 docSize = addY_I2(size_GmDocument(d->doc), height_Widget(d->footerButtons)); |
507 | if (docSize.y < rect.size.y) { | 507 | if (docSize.y < rect.size.y) { |
508 | /* Center vertically if short. There is one empty paragraph line's worth of margin | 508 | /* Center vertically if short. There is one empty paragraph line's worth of margin |
509 | between the banner and the page contents. */ | 509 | between the banner and the page contents. */ |
@@ -583,7 +583,8 @@ static float normScrollPos_DocumentWidget_(const iDocumentWidget *d) { | |||
583 | static int scrollMax_DocumentWidget_(const iDocumentWidget *d) { | 583 | static int scrollMax_DocumentWidget_(const iDocumentWidget *d) { |
584 | const iWidget *w = constAs_Widget(d); | 584 | const iWidget *w = constAs_Widget(d); |
585 | int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(w)) + | 585 | int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(w)) + |
586 | (hasSiteBanner_GmDocument(d->doc) ? 1 : 2) * d->pageMargin * gap_UI; | 586 | (hasSiteBanner_GmDocument(d->doc) ? 1 : 2) * d->pageMargin * gap_UI + |
587 | height_Widget(d->footerButtons); | ||
587 | if (d->phoneToolbar) { | 588 | if (d->phoneToolbar) { |
588 | sm += size_Root(w->root).y - | 589 | sm += size_Root(w->root).y - |
589 | top_Rect(boundsWithoutVisualOffset_Widget(d->phoneToolbar)); | 590 | top_Rect(boundsWithoutVisualOffset_Widget(d->phoneToolbar)); |
@@ -1040,10 +1041,12 @@ static void makeFooterButtons_DocumentWidget_(iDocumentWidget *d, const iMenuIte | |||
1040 | return; | 1041 | return; |
1041 | } | 1042 | } |
1042 | d->footerButtons = new_Widget(); | 1043 | d->footerButtons = new_Widget(); |
1044 | d->footerButtons->animOffsetRef = &d->scrollY.pos; | ||
1043 | setFlags_Widget(d->footerButtons, | 1045 | setFlags_Widget(d->footerButtons, |
1044 | unhittable_WidgetFlag | arrangeVertical_WidgetFlag | | 1046 | unhittable_WidgetFlag | arrangeVertical_WidgetFlag | |
1045 | resizeWidthOfChildren_WidgetFlag | arrangeHeight_WidgetFlag | | 1047 | resizeWidthOfChildren_WidgetFlag | arrangeHeight_WidgetFlag | |
1046 | fixedPosition_WidgetFlag | resizeToParentWidth_WidgetFlag, | 1048 | fixedPosition_WidgetFlag | resizeToParentWidth_WidgetFlag | |
1049 | moveToParentBottomEdge_WidgetFlag, | ||
1047 | iTrue); | 1050 | iTrue); |
1048 | setBackgroundColor_Widget(d->footerButtons, tmBannerBackground_ColorId); | 1051 | setBackgroundColor_Widget(d->footerButtons, tmBannerBackground_ColorId); |
1049 | const iRect bounds = bounds_Widget(w); | 1052 | const iRect bounds = bounds_Widget(w); |
@@ -1061,6 +1064,7 @@ static void makeFooterButtons_DocumentWidget_(iDocumentWidget *d, const iMenuIte | |||
1061 | } | 1064 | } |
1062 | addChild_Widget(as_Widget(d), iClob(d->footerButtons)); | 1065 | addChild_Widget(as_Widget(d), iClob(d->footerButtons)); |
1063 | arrange_Widget(d->footerButtons); | 1066 | arrange_Widget(d->footerButtons); |
1067 | arrange_Widget(w); | ||
1064 | } | 1068 | } |
1065 | 1069 | ||
1066 | static void showErrorPage_DocumentWidget_(iDocumentWidget *d, enum iGmStatusCode code, | 1070 | static void showErrorPage_DocumentWidget_(iDocumentWidget *d, enum iGmStatusCode code, |
@@ -1440,6 +1444,8 @@ static void updateFromCachedResponse_DocumentWidget_(iDocumentWidget *d, float n | |||
1440 | delete_Gempub(d->sourceGempub); | 1444 | delete_Gempub(d->sourceGempub); |
1441 | d->sourceGempub = NULL; | 1445 | d->sourceGempub = NULL; |
1442 | reset_GmDocument(d->doc); | 1446 | reset_GmDocument(d->doc); |
1447 | destroy_Widget(d->footerButtons); | ||
1448 | d->footerButtons = NULL; | ||
1443 | resetWideRuns_DocumentWidget_(d); | 1449 | resetWideRuns_DocumentWidget_(d); |
1444 | d->state = fetching_RequestState; | 1450 | d->state = fetching_RequestState; |
1445 | /* Do the fetch. */ { | 1451 | /* Do the fetch. */ { |
@@ -1718,6 +1724,8 @@ static void checkResponse_DocumentWidget_(iDocumentWidget *d) { | |||
1718 | reset_GmDocument(d->doc); /* new content incoming */ | 1724 | reset_GmDocument(d->doc); /* new content incoming */ |
1719 | delete_Gempub(d->sourceGempub); | 1725 | delete_Gempub(d->sourceGempub); |
1720 | d->sourceGempub = NULL; | 1726 | d->sourceGempub = NULL; |
1727 | destroy_Widget(d->footerButtons); | ||
1728 | d->footerButtons = NULL; | ||
1721 | resetWideRuns_DocumentWidget_(d); | 1729 | resetWideRuns_DocumentWidget_(d); |
1722 | updateDocument_DocumentWidget_(d, resp, iTrue); | 1730 | updateDocument_DocumentWidget_(d, resp, iTrue); |
1723 | break; | 1731 | break; |