diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/documentwidget.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index a762cb01..aceae0fa 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -526,7 +526,8 @@ static iRect documentBounds_DocumentWidget_(const iDocumentWidget *d) { | |||
526 | rect.size.y -= margin; | 526 | rect.size.y -= margin; |
527 | } | 527 | } |
528 | if (d->flags & centerVertically_DocumentWidgetFlag) { | 528 | if (d->flags & centerVertically_DocumentWidgetFlag) { |
529 | const iInt2 docSize = size_GmDocument(d->doc); | 529 | const iInt2 docSize = addY_I2(size_GmDocument(d->doc), |
530 | iMax(height_Widget(d->footerButtons), height_Widget(d->phoneToolbar))); | ||
530 | if (docSize.y < rect.size.y) { | 531 | if (docSize.y < rect.size.y) { |
531 | /* Center vertically if short. There is one empty paragraph line's worth of margin | 532 | /* Center vertically if short. There is one empty paragraph line's worth of margin |
532 | between the banner and the page contents. */ | 533 | between the banner and the page contents. */ |
@@ -608,11 +609,13 @@ static int scrollMax_DocumentWidget_(const iDocumentWidget *d) { | |||
608 | const iWidget *w = constAs_Widget(d); | 609 | const iWidget *w = constAs_Widget(d); |
609 | int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(w)) + | 610 | int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(w)) + |
610 | (hasSiteBanner_GmDocument(d->doc) ? 1 : 2) * d->pageMargin * gap_UI + | 611 | (hasSiteBanner_GmDocument(d->doc) ? 1 : 2) * d->pageMargin * gap_UI + |
611 | height_Widget(d->footerButtons); | 612 | iMax(height_Widget(d->phoneToolbar), height_Widget(d->footerButtons)); |
612 | if (d->phoneToolbar) { | 613 | // sm += height_Widget(d->phoneToolbar); |
613 | sm += size_Root(w->root).y - | 614 | // if (d->phoneToolbar) { |
614 | top_Rect(boundsWithoutVisualOffset_Widget(d->phoneToolbar)); | 615 | // sm += size_Root(w->root).y - |
615 | } | 616 | // top_Rect(boundsWithoutVisualOffset_Widget(d->phoneToolbar)); |
617 | // sm += height_Widget(d->phoneToolbar); | ||
618 | // } | ||
616 | return sm; | 619 | return sm; |
617 | } | 620 | } |
618 | 621 | ||
@@ -878,10 +881,12 @@ static void updateVisible_DocumentWidget_(iDocumentWidget *d) { | |||
878 | else { | 881 | else { |
879 | d->footerButtons->animOffsetRef = &d->scrollY.pos; | 882 | d->footerButtons->animOffsetRef = &d->scrollY.pos; |
880 | d->footerButtons->rect.pos.y = size_GmDocument(d->doc).y + 2 * gap_UI * d->pageMargin; | 883 | d->footerButtons->rect.pos.y = size_GmDocument(d->doc).y + 2 * gap_UI * d->pageMargin; |
884 | // + height_Widget(d->phoneToolbar); | ||
881 | } | 885 | } |
882 | } | 886 | } |
883 | setRange_ScrollWidget(d->scroll, (iRangei){ 0, scrollMax }); | 887 | setRange_ScrollWidget(d->scroll, (iRangei){ 0, scrollMax }); |
884 | const int docSize = size_GmDocument(d->doc).y; | 888 | const int docSize = size_GmDocument(d->doc).y + iMax(height_Widget(d->phoneToolbar), |
889 | height_Widget(d->footerButtons)); | ||
885 | setThumb_ScrollWidget(d->scroll, | 890 | setThumb_ScrollWidget(d->scroll, |
886 | pos_SmoothScroll(&d->scrollY), | 891 | pos_SmoothScroll(&d->scrollY), |
887 | docSize > 0 ? height_Rect(bounds) * size_Range(&visRange) / docSize : 0); | 892 | docSize > 0 ? height_Rect(bounds) * size_Range(&visRange) / docSize : 0); |