summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-02 14:17:00 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-02 14:17:00 +0200
commit6d885dee5e3a9fc7316c901542eec21e39ae1f12 (patch)
tree2b8a2acb393329317e975d4294f28a5a34967d9a /src/app.c
parentec82863a833d3533381dddbb170a8505a24e159d (diff)
Improved focus switching for dialogs
Widgets can now be defined as being the "focus root", i.e., the topmost widget under which focus switching happens. Normally this is the window root widget, but dialogs use this flag to confine focus switching inside the dialog. InputWidget in Overwrite mode will focus switch to the next focusable widget when the text field becomes full.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/app.c b/src/app.c
index 29d88c2b..f44fdf4f 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1008,7 +1008,7 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) {
1008 sscanf(cstr_String(text_InputWidget(findChild_Widget(dlg, "ident.until"))), 1008 sscanf(cstr_String(text_InputWidget(findChild_Widget(dlg, "ident.until"))),
1009 "%04u-%u-%u %u:%u:%u", 1009 "%04u-%u-%u %u:%u:%u",
1010 &val[0], &val[1], &val[2], &val[3], &val[4], &val[5]); 1010 &val[0], &val[1], &val[2], &val[3], &val[4], &val[5]);
1011 if (n <= 0 || val[0] < (unsigned) today.year) { 1011 if (n <= 0) {
1012 makeMessage_Widget(orange_ColorEscape "INVALID DATE", 1012 makeMessage_Widget(orange_ColorEscape "INVALID DATE",
1013 "Please check the \"Valid until\" date. Examples:\n" 1013 "Please check the \"Valid until\" date. Examples:\n"
1014 "\u2022 2030\n" 1014 "\u2022 2030\n"
@@ -1022,6 +1022,7 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) {
1022 until.hour = n >= 4 ? val[3] : 0; 1022 until.hour = n >= 4 ? val[3] : 0;
1023 until.minute = n >= 5 ? val[4] : 0; 1023 until.minute = n >= 5 ? val[4] : 0;
1024 until.second = n == 6 ? val[5] : 0; 1024 until.second = n == 6 ? val[5] : 0;
1025 until.gmtOffsetSeconds = today.gmtOffsetSeconds;
1025 /* In the past? */ { 1026 /* In the past? */ {
1026 iTime now, t; 1027 iTime now, t;
1027 initCurrent_Time(&now); 1028 initCurrent_Time(&now);
@@ -1471,6 +1472,7 @@ iBool handleCommand_App(const char *cmd) {
1471 } 1472 }
1472 else if (equal_Command(cmd, "ident.new")) { 1473 else if (equal_Command(cmd, "ident.new")) {
1473 iWidget *dlg = makeIdentityCreation_Widget(); 1474 iWidget *dlg = makeIdentityCreation_Widget();
1475 setFocus_Widget(findChild_Widget(dlg, "ident.until"));
1474 setCommandHandler_Widget(dlg, handleIdentityCreationCommands_); 1476 setCommandHandler_Widget(dlg, handleIdentityCreationCommands_);
1475 return iTrue; 1477 return iTrue;
1476 } 1478 }