Skip to content

Commit

Permalink
Merge pull request #352 from kefoster951/master
Browse files Browse the repository at this point in the history
Changed active_input selection to be based on default config
  • Loading branch information
AnErrupTion committed May 16, 2022
2 parents 78e2fd1 + bd04d69 commit dec2ef1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 9 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,15 @@ 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 (config.default_input == LOGIN_INPUT && login.text != login.end){
active_input = PASSWORD_INPUT;
}
else{
active_input = config.default_input;
}


// init drawing stuff
Expand Down

0 comments on commit dec2ef1

Please sign in to comment.