summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-10-22 14:10:51 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-10-22 14:11:08 +0300
commitb53e1f203b57ab6deb088b50135ee49889356f84 (patch)
treedf3121a3359ddcecc89b2db7b21ff0560d68f823 /src
parent842f6b8dd3816c8d99ec3bad6ddf09aab0124bd2 (diff)
DocumentWidget: Not scrollable until mouse moved
The hover widget needs updating if the currently visible tab changes. Normally the hover widget is only updated when the mouse has moved.
Diffstat (limited to 'src')
-rw-r--r--src/ui/documentwidget.c1
-rw-r--r--src/ui/window.c7
-rw-r--r--src/ui/window.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 8e4e2752..b6f3b5ce 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -2683,6 +2683,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
2683 updateSize_DocumentWidget(d); 2683 updateSize_DocumentWidget(d);
2684 showOrHidePinningIndicator_DocumentWidget_(d); 2684 showOrHidePinningIndicator_DocumentWidget_(d);
2685 updateFetchProgress_DocumentWidget_(d); 2685 updateFetchProgress_DocumentWidget_(d);
2686 updateHover_Window(window_Widget(w));
2686 } 2687 }
2687 init_Anim(&d->sideOpacity, 0); 2688 init_Anim(&d->sideOpacity, 0);
2688 init_Anim(&d->altTextOpacity, 0); 2689 init_Anim(&d->altTextOpacity, 0);
diff --git a/src/ui/window.c b/src/ui/window.c
index 83dae427..352b0797 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -952,6 +952,10 @@ static void applyCursor_Window_(iWindow *d) {
952 } 952 }
953} 953}
954 954
955void updateHover_Window(iWindow *d) {
956 d->hover = hitChild_Window(d, mouseCoord_Window(d, 0));
957}
958
955iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { 959iBool processEvent_Window(iWindow *d, const SDL_Event *ev) {
956 iMainWindow *mw = (type_Window(d) == main_WindowType ? as_MainWindow(d) : NULL); 960 iMainWindow *mw = (type_Window(d) == main_WindowType ? as_MainWindow(d) : NULL);
957 switch (ev->type) { 961 switch (ev->type) {
@@ -1149,6 +1153,9 @@ iBool dispatchEvent_Window(iWindow *d, const SDL_Event *ev) {
1149} 1153}
1150 1154
1151iAnyObject *hitChild_Window(const iWindow *d, iInt2 coord) { 1155iAnyObject *hitChild_Window(const iWindow *d, iInt2 coord) {
1156 if (coord.x < 0 || coord.y < 0) {
1157 return NULL;
1158 }
1152 iForIndices(i, d->roots) { 1159 iForIndices(i, d->roots) {
1153 if (d->roots[i]) { 1160 if (d->roots[i]) {
1154 iAnyObject *hit = hitChild_Widget(d->roots[i]->widget, coord); 1161 iAnyObject *hit = hitChild_Widget(d->roots[i]->widget, coord);
diff --git a/src/ui/window.h b/src/ui/window.h
index 81fc2c06..6c921f09 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -146,6 +146,7 @@ void setUiScale_Window (iWindow *, float uiScale);
146void setCursor_Window (iWindow *, int cursor); 146void setCursor_Window (iWindow *, int cursor);
147iBool setKeyRoot_Window (iWindow *, iRoot *root); 147iBool setKeyRoot_Window (iWindow *, iRoot *root);
148iBool postContextClick_Window (iWindow *, const SDL_MouseButtonEvent *); 148iBool postContextClick_Window (iWindow *, const SDL_MouseButtonEvent *);
149void updateHover_Window (iWindow *);
149 150
150iWindow * get_Window (void); 151iWindow * get_Window (void);
151iBool isOpenGLRenderer_Window (void); 152iBool isOpenGLRenderer_Window (void);