summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-15 06:26:14 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-15 06:26:14 +0200
commitbc8cc04a7aabad391df2978f39dfeee4c01c505e (patch)
tree3f27478bc9f7d66c078e6d7dc01fc7ed4f6c97c6 /src
parent4dee43aa5c460850268c1acea263d4ff510e7c15 (diff)
Mobile: Dismissing keyboard unfocuses InputWidget
Diffstat (limited to 'src')
-rw-r--r--src/ui/inputwidget.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index fe897ed4..c60cd99e 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -2189,15 +2189,16 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) {
2189 return iFalse; 2189 return iFalse;
2190 } 2190 }
2191 else if (isCommand_UserEvent(ev, "keyboard.changed")) { 2191 else if (isCommand_UserEvent(ev, "keyboard.changed")) {
2192 /* Scroll to keep widget visible when keyboard appears. */ 2192 const iBool isKeyboardVisible = (arg_Command(command_UserEvent(ev)) != 0);
2193 if (isFocused_Widget(d) && arg_Command(command_UserEvent(ev))) { 2193 /* Scroll to keep widget visible when keyboard appears. */
2194 d->lastOverflowScrollTime = SDL_GetTicks(); 2194 if (isFocused_Widget(d)) {
2195 overflowScrollToKeepVisible_InputWidget_(d); 2195 if (isKeyboardVisible) {
2196// rect.pos.y -= value_Anim(&get_Window()->rootOffset); 2196 d->lastOverflowScrollTime = SDL_GetTicks();
2197 //const iInt2 visRoot = visibleSize_Root(w->root); 2197 overflowScrollToKeepVisible_InputWidget_(d);
2198 //if (bottom_Rect(rect) > visRoot.y) { 2198 }
2199 //setValue_Anim(&get_Window()->rootOffset, -(bottom_Rect(rect) - visRoot.y), 250); 2199 else {
2200 //} 2200 setFocus_Widget(NULL); /* stop editing */
2201 }
2201 } 2202 }
2202 return iFalse; 2203 return iFalse;
2203 } 2204 }