From 66fe7a034764a5c039d130e743b739c46a439043 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 8 Apr 2021 15:02:58 +0300 Subject: Mobile: Adjusted toolbar show/hide behavior --- src/ui/documentwidget.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/ui/documentwidget.c') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index e4dadeff..3c16df74 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1183,6 +1183,12 @@ static void smoothScroll_DocumentWidget_(iDocumentWidget *d, int offset, int dur setLinkNumberMode_DocumentWidget_(d, iFalse); invalidateVisibleLinks_DocumentWidget_(d); } + /* Show and hide toolbar on scroll. */ + if (deviceType_App() == phone_AppDeviceType) { + if (prefs_App()->hideToolbarOnScroll && iAbs(offset) > 5) { + showToolbars_Window(get_Window(), offset < 0); + } + } if (!prefs_App()->smoothScrolling) { duration = 0; /* always instant */ } @@ -1193,14 +1199,6 @@ static void smoothScroll_DocumentWidget_(iDocumentWidget *d, int offset, int dur const int scrollMax = scrollMax_DocumentWidget_(d); if (scrollMax > 0) { destY = iMin(destY, scrollMax); - if (deviceType_App() == phone_AppDeviceType) { - if (destY == scrollMax) { - showToolbars_Window(get_Window(), iTrue); - } - else if (prefs_App()->hideToolbarOnScroll && iAbs(offset) > 5) { - showToolbars_Window(get_Window(), offset < 0); - } - } } else { destY = 0; -- cgit v1.2.3