summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 17:01:58 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-27 17:01:58 +0300
commit852689943bfbbbb933ba617cb0a971f82923a2f3 (patch)
tree11f7b934e5ea0fdd4f96efabbb213eb3189d6863 /src/ui/documentwidget.c
parent379c1f8befcc30b72f0b50dcbd653704348e4761 (diff)
Refactor: Update event processing to not assume a single UI root
Most actions should occur in the context of the current UI root.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index e09844c2..79678f56 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -567,7 +567,7 @@ static int scrollMax_DocumentWidget_(const iDocumentWidget *d) {
567 int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(constAs_Widget(d))) + 567 int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(constAs_Widget(d))) +
568 (hasSiteBanner_GmDocument(d->doc) ? 1 : 2) * d->pageMargin * gap_UI; 568 (hasSiteBanner_GmDocument(d->doc) ? 1 : 2) * d->pageMargin * gap_UI;
569 if (d->phoneToolbar) { 569 if (d->phoneToolbar) {
570 sm += size_Root(get_Root()).y - 570 sm += size_Root(constAs_Widget(d)->root).y -
571 top_Rect(boundsWithoutVisualOffset_Widget(d->phoneToolbar)); 571 top_Rect(boundsWithoutVisualOffset_Widget(d->phoneToolbar));
572 } 572 }
573 return sm; 573 return sm;
@@ -1354,7 +1354,7 @@ static void scrollBegan_DocumentWidget_(iAnyObject *any, int offset, uint32_t du
1354 /* Show and hide toolbar on scroll. */ 1354 /* Show and hide toolbar on scroll. */
1355 if (deviceType_App() == phone_AppDeviceType) { 1355 if (deviceType_App() == phone_AppDeviceType) {
1356 if (prefs_App()->hideToolbarOnScroll && iAbs(offset) > 5) { 1356 if (prefs_App()->hideToolbarOnScroll && iAbs(offset) > 5) {
1357 showToolbars_Root(get_Root(), offset < 0); 1357 showToolbars_Root(as_Widget(d)->root, offset < 0);
1358 } 1358 }
1359 } 1359 }
1360 updateVisible_DocumentWidget_(d); 1360 updateVisible_DocumentWidget_(d);