From 559f2f73700ddd4c6a50222a247ffa07179957a7 Mon Sep 17 00:00:00 2001 From: kefoster951 <42386206+kefoster951@users.noreply.github.com> Date: Thu, 12 May 2022 11:05:23 -0400 Subject: [PATCH 1/3] Update main.c changed how the curser placement works to be based on if there is a saved username or not --- src/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 7cc0d69..6792aa1 100644 --- a/src/main.c +++ b/src/main.c @@ -135,8 +135,16 @@ int main(int argc, char** argv) // init visible elements struct tb_event event; struct term_buf buf; - uint8_t active_input = config.default_input; - + + //Place the curser on the login field if there is no saved username, if there is, place the curser on the password field + uint8_t active_input; + if (login.text == login.end) + { + active_input = LOGIN_INPUT; + } + else{ + active_input = PASSWORD_INPUT; + } // init drawing stuff draw_init(&buf); From a078a07ee784e1f9e95ff93e318d0eb35a675b58 Mon Sep 17 00:00:00 2001 From: kefoster951 <42386206+kefoster951@users.noreply.github.com> Date: Fri, 13 May 2022 09:11:00 -0400 Subject: [PATCH 2/3] Update main.c --- src/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.c b/src/main.c index 6792aa1..2b9832d 100644 --- a/src/main.c +++ b/src/main.c @@ -138,13 +138,13 @@ int main(int argc, char** argv) //Place the curser on the login field if there is no saved username, if there is, place the curser on the password field uint8_t active_input; - if (login.text == login.end) - { - active_input = LOGIN_INPUT; - } - else{ - active_input = PASSWORD_INPUT; - } + if (config.default_input == LOGIN_INPUT && login.text != login.end){ + active_input = PASSWORD_INPUT; + } + else{ + active_input = config.default_input; + } + // init drawing stuff draw_init(&buf); From bd04d69b4d3bfa7478a71c33231527eed0b368ac Mon Sep 17 00:00:00 2001 From: kefoster951 <42386206+kefoster951@users.noreply.github.com> Date: Fri, 13 May 2022 09:12:24 -0400 Subject: [PATCH 3/3] Changed default input to login field --- src/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index 640aa97..0881bfc 100644 --- a/src/config.c +++ b/src/config.c @@ -271,7 +271,7 @@ void config_defaults() config.blank_box = true; config.blank_password = false; config.console_dev = strdup("/dev/console"); - config.default_input = PASSWORD_INPUT; + config.default_input = LOGIN_INPUT; config.fg = 9; config.hide_borders = false; config.input_len = 34;