From 2791f810fe53f1225d07ed4680ed87a133bb5ab8 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 28 Jan 2022 14:55:51 +0200 Subject: iOS: Scroll to top on status bar taps --- src/ui/documentwidget.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ui/documentwidget.c') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index beff0f3f..2e15cdce 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -4351,6 +4351,12 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) return iTrue; } else if (equal_Command(cmd, "scroll.top") && document_App() == d) { + if (argLabel_Command(cmd, "smooth")) { + stopWidgetMomentum_Touch(w); + smoothScroll_DocumentView_(&d->view, -pos_SmoothScroll(&d->view.scrollY), 500); + d->view.scrollY.flags |= muchSofter_AnimFlag; + return iTrue; + } init_Anim(&d->view.scrollY.pos, 0); invalidate_VisBuf(d->view.visBuf); clampScroll_DocumentView_(&d->view); -- cgit v1.2.3