mirror of https://github.com/fairyglade/ly.git
Merge pull request #352 from kefoster951/master
Changed active_input selection to be based on default config
This commit is contained in:
commit
dec2ef14e0
|
@ -271,7 +271,7 @@ void config_defaults()
|
||||||
config.blank_box = true;
|
config.blank_box = true;
|
||||||
config.blank_password = false;
|
config.blank_password = false;
|
||||||
config.console_dev = strdup("/dev/console");
|
config.console_dev = strdup("/dev/console");
|
||||||
config.default_input = PASSWORD_INPUT;
|
config.default_input = LOGIN_INPUT;
|
||||||
config.fg = 9;
|
config.fg = 9;
|
||||||
config.hide_borders = false;
|
config.hide_borders = false;
|
||||||
config.input_len = 34;
|
config.input_len = 34;
|
||||||
|
|
10
src/main.c
10
src/main.c
|
@ -135,7 +135,15 @@ int main(int argc, char** argv)
|
||||||
// init visible elements
|
// init visible elements
|
||||||
struct tb_event event;
|
struct tb_event event;
|
||||||
struct term_buf buf;
|
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
|
// init drawing stuff
|
||||||
|
|
Loading…
Reference in New Issue