Feat: UI / UX
This commit is contained in:
@@ -90,4 +90,5 @@ pub enum Modal {
|
||||
steps: String,
|
||||
rotation: String,
|
||||
},
|
||||
Onboarding,
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ pub enum OptionsFocus {
|
||||
MidiInput1,
|
||||
MidiInput2,
|
||||
MidiInput3,
|
||||
ResetOnboarding,
|
||||
}
|
||||
|
||||
impl CyclicEnum for OptionsFocus {
|
||||
@@ -45,6 +46,7 @@ impl CyclicEnum for OptionsFocus {
|
||||
Self::MidiInput1,
|
||||
Self::MidiInput2,
|
||||
Self::MidiInput3,
|
||||
Self::ResetOnboarding,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -68,6 +70,7 @@ const FOCUS_LINES: &[(OptionsFocus, usize)] = &[
|
||||
(OptionsFocus::MidiInput1, 33),
|
||||
(OptionsFocus::MidiInput2, 34),
|
||||
(OptionsFocus::MidiInput3, 35),
|
||||
(OptionsFocus::ResetOnboarding, 39),
|
||||
];
|
||||
|
||||
impl OptionsFocus {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::cell::RefCell;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use cagire_markdown::ParsedMarkdown;
|
||||
use cagire_ratatui::Sparkles;
|
||||
use tachyonfx::{fx, Effect, EffectManager, Interpolation};
|
||||
|
||||
@@ -49,6 +50,8 @@ pub struct UiState {
|
||||
pub help_scrolls: Vec<usize>,
|
||||
pub help_search_active: bool,
|
||||
pub help_search_query: String,
|
||||
pub help_focused_block: Option<usize>,
|
||||
pub help_parsed: RefCell<Vec<Option<ParsedMarkdown>>>,
|
||||
pub dict_focus: DictFocus,
|
||||
pub dict_category: usize,
|
||||
pub dict_scrolls: Vec<usize>,
|
||||
@@ -66,6 +69,7 @@ pub struct UiState {
|
||||
pub prev_modal_open: bool,
|
||||
pub prev_page: Page,
|
||||
pub prev_show_title: bool,
|
||||
pub onboarding_dismissed: Vec<String>,
|
||||
}
|
||||
|
||||
impl Default for UiState {
|
||||
@@ -81,6 +85,8 @@ impl Default for UiState {
|
||||
help_scrolls: vec![0; crate::model::docs::topic_count()],
|
||||
help_search_active: false,
|
||||
help_search_query: String::new(),
|
||||
help_focused_block: None,
|
||||
help_parsed: RefCell::new((0..crate::model::docs::topic_count()).map(|_| None).collect()),
|
||||
dict_focus: DictFocus::default(),
|
||||
dict_category: 0,
|
||||
dict_scrolls: vec![0; crate::model::categories::category_count()],
|
||||
@@ -98,6 +104,7 @@ impl Default for UiState {
|
||||
prev_modal_open: false,
|
||||
prev_page: Page::default(),
|
||||
prev_show_title: true,
|
||||
onboarding_dismissed: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user