diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-11 18:14:33 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-11 18:14:33 +0300 |
commit | 15c5ab9ec7563fb6fcb49657e075729c18461c3b (patch) | |
tree | ac203b1966879f9793055f11d86967f49ff6256e /src/ui/root.c | |
parent | a13543aa922647ea2f8cc40cb9f3f797df8758df (diff) |
InputWidget: Word wrapping, inserting newlines
Diffstat (limited to 'src/ui/root.c')
-rw-r--r-- | src/ui/root.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ui/root.c b/src/ui/root.c index 43fadbfa..8db8f7af 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -285,6 +285,16 @@ void destroyPending_Root(iRoot *d) { | |||
285 | setCurrent_Root(NULL); | 285 | setCurrent_Root(NULL); |
286 | } | 286 | } |
287 | 287 | ||
288 | void postArrange_Root(iRoot *d) { | ||
289 | if (!d->pendingArrange) { | ||
290 | d->pendingArrange = iTrue; | ||
291 | SDL_Event ev = { .type = SDL_USEREVENT }; | ||
292 | ev.user.code = arrange_UserEventCode; | ||
293 | ev.user.data2 = d; | ||
294 | SDL_PushEvent(&ev); | ||
295 | } | ||
296 | } | ||
297 | |||
288 | iPtrArray *onTop_Root(iRoot *d) { | 298 | iPtrArray *onTop_Root(iRoot *d) { |
289 | if (!d->onTop) { | 299 | if (!d->onTop) { |
290 | d->onTop = new_PtrArray(); | 300 | d->onTop = new_PtrArray(); |
@@ -337,6 +347,12 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) { | |||
337 | setFocus_Widget(findWidget_App(cstr_Rangecc(range_Command(cmd, "id")))); | 347 | setFocus_Widget(findWidget_App(cstr_Rangecc(range_Command(cmd, "id")))); |
338 | return iTrue; | 348 | return iTrue; |
339 | } | 349 | } |
350 | else if (equal_Command(cmd, "input.resized")) { | ||
351 | /* No parent handled this, so do a full rearrangement. */ | ||
352 | arrange_Widget(root); | ||
353 | postRefresh_App(); | ||
354 | return iTrue; | ||
355 | } | ||
340 | else if (equal_Command(cmd, "window.focus.lost")) { | 356 | else if (equal_Command(cmd, "window.focus.lost")) { |
341 | #if !defined (iPlatformMobile) /* apps don't share input focus on mobile */ | 357 | #if !defined (iPlatformMobile) /* apps don't share input focus on mobile */ |
342 | setFocus_Widget(NULL); | 358 | setFocus_Widget(NULL); |