Feat: fixing ratatui big-text and UX
This commit is contained in:
@@ -525,14 +525,37 @@ pub(super) fn handle_modal_input(ctx: &mut InputContext, key: KeyEvent) -> Input
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
Modal::Onboarding => match key.code {
|
||||
KeyCode::Enter => {
|
||||
ctx.dispatch(AppCommand::DismissOnboarding);
|
||||
ctx.dispatch(AppCommand::CloseModal);
|
||||
ctx.app.save_settings(ctx.link);
|
||||
Modal::Onboarding { .. } => {
|
||||
let pages = ctx.app.page.onboarding();
|
||||
let page_count = pages.len();
|
||||
match key.code {
|
||||
KeyCode::Right | KeyCode::Char('l') if page_count > 1 => {
|
||||
if let Modal::Onboarding { page } = &mut ctx.app.ui.modal {
|
||||
if *page + 1 < page_count {
|
||||
*page += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
KeyCode::Left | KeyCode::Char('h') if page_count > 1 => {
|
||||
if let Modal::Onboarding { page } = &mut ctx.app.ui.modal {
|
||||
*page = page.saturating_sub(1);
|
||||
}
|
||||
}
|
||||
KeyCode::Char('?') | KeyCode::F(1) => {
|
||||
if let Some(topic) = ctx.app.page.help_topic_index() {
|
||||
ctx.dispatch(AppCommand::GoToHelpTopic(topic));
|
||||
} else {
|
||||
ctx.dispatch(AppCommand::CloseModal);
|
||||
}
|
||||
}
|
||||
KeyCode::Enter => {
|
||||
ctx.dispatch(AppCommand::DismissOnboarding);
|
||||
ctx.dispatch(AppCommand::CloseModal);
|
||||
ctx.app.save_settings(ctx.link);
|
||||
}
|
||||
_ => ctx.dispatch(AppCommand::CloseModal),
|
||||
}
|
||||
_ => ctx.dispatch(AppCommand::CloseModal),
|
||||
},
|
||||
}
|
||||
Modal::None => unreachable!(),
|
||||
}
|
||||
InputResult::Continue
|
||||
|
||||
Reference in New Issue
Block a user