modifier tr + ajout/modifier ac

This commit is contained in:
thatscringebro
2026-03-13 11:41:57 -04:00
parent 9bfc0c4304
commit 460f6e9c94
8 changed files with 213 additions and 15 deletions

View File

@@ -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;