summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-05 18:31:52 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-05 18:31:52 +0200
commit14e4bd38636f7dccd8a22d868cf82134592a98db (patch)
tree6723365141a329b7aed1fc05de20f463f81fe7d1 /src/ui
parent7ce63a96eafd7ee94a0ff34230909b8cb3f85ca4 (diff)
Mobile: Fixed issues with overflow-scrolling
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/root.c2
-rw-r--r--src/ui/root.h1
-rw-r--r--src/ui/widget.c5
3 files changed, 6 insertions, 2 deletions
diff --git a/src/ui/root.c b/src/ui/root.c
index e2706898..28aa4b92 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -661,7 +661,7 @@ void updateToolbarColors_Root(iRoot *d) {
661} 661}
662 662
663void notifyVisualOffsetChange_Root(iRoot *d) { 663void notifyVisualOffsetChange_Root(iRoot *d) {
664 if (d && d->didAnimateVisualOffsets) { 664 if (d && (d->didAnimateVisualOffsets || d->didOverflowScroll)) {
665 iNotifyAudience(d, visualOffsetsChanged, RootVisualOffsetsChanged); 665 iNotifyAudience(d, visualOffsetsChanged, RootVisualOffsetsChanged);
666 } 666 }
667} 667}
diff --git a/src/ui/root.h b/src/ui/root.h
index 2419b599..2f0d72c9 100644
--- a/src/ui/root.h
+++ b/src/ui/root.h
@@ -19,6 +19,7 @@ struct Impl_Root {
19 iBool pendingArrange; 19 iBool pendingArrange;
20 int loadAnimTimer; 20 int loadAnimTimer;
21 iBool didAnimateVisualOffsets; 21 iBool didAnimateVisualOffsets;
22 iBool didOverflowScroll;
22 iAudience *visualOffsetsChanged; /* called after running tickers */ 23 iAudience *visualOffsetsChanged; /* called after running tickers */
23 iColor tmPalette[tmMax_ColorId]; /* theme-specific palette */ 24 iColor tmPalette[tmMax_ColorId]; /* theme-specific palette */
24}; 25};
diff --git a/src/ui/widget.c b/src/ui/widget.c
index 225c0480..bb3a39f1 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -1203,6 +1203,9 @@ iBool scrollOverflow_Widget(iWidget *d, int delta) {
1203 bounds.pos.y = iMin(bounds.pos.y, validPosRange.end); 1203 bounds.pos.y = iMin(bounds.pos.y, validPosRange.end);
1204 } 1204 }
1205// printf("range: %d ... %d\n", range.start, range.end); 1205// printf("range: %d ... %d\n", range.start, range.end);
1206 if (delta) {
1207 d->root->didOverflowScroll = iTrue; /* ensure that widgets update if needed */
1208 }
1206 } 1209 }
1207 else { 1210 else {
1208 bounds.pos.y = iClamp(bounds.pos.y, validPosRange.start, validPosRange.end); 1211 bounds.pos.y = iClamp(bounds.pos.y, validPosRange.start, validPosRange.end);
@@ -1871,7 +1874,7 @@ iAny *findParentClass_Widget(const iWidget *d, const iAnyClass *class) {
1871} 1874}
1872 1875
1873iAny *findOverflowScrollable_Widget(iWidget *d) { 1876iAny *findOverflowScrollable_Widget(iWidget *d) {
1874 const iRect rootRect = rect_Root(d->root); 1877 const iRect rootRect = visibleRect_Root(d->root);
1875 for (iWidget *w = d; w; w = parent_Widget(w)) { 1878 for (iWidget *w = d; w; w = parent_Widget(w)) {
1876 if (flags_Widget(w) & overflowScrollable_WidgetFlag) { 1879 if (flags_Widget(w) & overflowScrollable_WidgetFlag) {
1877 const iRect bounds = boundsWithoutVisualOffset_Widget(w); 1880 const iRect bounds = boundsWithoutVisualOffset_Widget(w);