modifier tr + ajout/modifier ac
This commit is contained in:
24
src/main.rs
24
src/main.rs
@@ -101,9 +101,33 @@ where
|
||||
app.new_transaction.set_date(Local::now());
|
||||
}
|
||||
},
|
||||
KeyCode::Char('m') => match app.current_widget {
|
||||
CurrentWidget::AccountList => {
|
||||
app.current_screen = CurrentScreen::NewAccount;
|
||||
app.new_account = app.acc_list.selected_ac();
|
||||
app.set_current_input_ac();
|
||||
}
|
||||
CurrentWidget::TrxList => {
|
||||
app.current_screen = CurrentScreen::NewTransaction;
|
||||
app.new_transaction = app.trx_table.selected_tr();
|
||||
app.set_current_input_tr();
|
||||
}
|
||||
},
|
||||
_ => {}
|
||||
},
|
||||
CurrentScreen::NewAccount => match key.code {
|
||||
KeyCode::Down => {
|
||||
app.next_ac_input();
|
||||
}
|
||||
KeyCode::Up => {
|
||||
app.previous_ac_input();
|
||||
}
|
||||
KeyCode::Backspace => {
|
||||
app.current_input.pop();
|
||||
}
|
||||
KeyCode::Char(value) => {
|
||||
app.current_input.push(value);
|
||||
}
|
||||
KeyCode::Enter => {
|
||||
app.save_new_account();
|
||||
app.current_screen = CurrentScreen::Main;
|
||||
|
||||
Reference in New Issue
Block a user