Moved primary lcd and navigation into dedicated files

This commit was merged in pull request #18.
This commit is contained in:
2026-08-02 15:45:04 +02:00
committed by rhetenor
parent 30ba5e3796
commit 1d073df5a1
4 changed files with 128 additions and 68 deletions
+35 -1
View File
@@ -1 +1,35 @@
// Navigation state module
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ScreenMode {
CardDetail,
DexGrid,
Settings,
}
#[derive(Debug, Clone, Copy)]
pub struct NavigationState {
pub current_screen: ScreenMode,
pub card_index: usize,
pub use_first_payload: bool,
}
impl Default for NavigationState {
fn default() -> Self {
Self {
current_screen: ScreenMode::CardDetail,
card_index: 0,
use_first_payload: true,
}
}
}
impl NavigationState {
pub fn new() -> Self {
Self::default()
}
pub fn toggle_payload(&mut self) -> bool {
let current = self.use_first_payload;
self.use_first_payload = !self.use_first_payload;
current
}
}