summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-08 15:02:58 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-08 15:02:58 +0300
commit66fe7a034764a5c039d130e743b739c46a439043 (patch)
treec494022a1ee4e248488f53663e4512c5f64a6218 /src/ui/documentwidget.c
parentbf3e015c1a96b4bf147a2003b426568adfeb7e46 (diff)
Mobile: Adjusted toolbar show/hide behavior
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c14
1 files changed, 6 insertions, 8 deletions
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
1183 setLinkNumberMode_DocumentWidget_(d, iFalse); 1183 setLinkNumberMode_DocumentWidget_(d, iFalse);
1184 invalidateVisibleLinks_DocumentWidget_(d); 1184 invalidateVisibleLinks_DocumentWidget_(d);
1185 } 1185 }
1186 /* Show and hide toolbar on scroll. */
1187 if (deviceType_App() == phone_AppDeviceType) {
1188 if (prefs_App()->hideToolbarOnScroll && iAbs(offset) > 5) {
1189 showToolbars_Window(get_Window(), offset < 0);
1190 }
1191 }
1186 if (!prefs_App()->smoothScrolling) { 1192 if (!prefs_App()->smoothScrolling) {
1187 duration = 0; /* always instant */ 1193 duration = 0; /* always instant */
1188 } 1194 }
@@ -1193,14 +1199,6 @@ static void smoothScroll_DocumentWidget_(iDocumentWidget *d, int offset, int dur
1193 const int scrollMax = scrollMax_DocumentWidget_(d); 1199 const int scrollMax = scrollMax_DocumentWidget_(d);
1194 if (scrollMax > 0) { 1200 if (scrollMax > 0) {
1195 destY = iMin(destY, scrollMax); 1201 destY = iMin(destY, scrollMax);
1196 if (deviceType_App() == phone_AppDeviceType) {
1197 if (destY == scrollMax) {
1198 showToolbars_Window(get_Window(), iTrue);
1199 }
1200 else if (prefs_App()->hideToolbarOnScroll && iAbs(offset) > 5) {
1201 showToolbars_Window(get_Window(), offset < 0);
1202 }
1203 }
1204 } 1202 }
1205 else { 1203 else {
1206 destY = 0; 1204 destY = 0;