Moved primary lcd and navigation into dedicated files
This commit is contained in:
+35
-1
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user