ok
This commit is contained in:
16
src/page.rs
16
src/page.rs
@@ -3,9 +3,10 @@ pub enum Page {
|
||||
#[default]
|
||||
Main,
|
||||
Patterns,
|
||||
Audio,
|
||||
Engine,
|
||||
Help,
|
||||
Dict,
|
||||
Options,
|
||||
}
|
||||
|
||||
impl Page {
|
||||
@@ -13,9 +14,10 @@ impl Page {
|
||||
pub const ALL: &'static [Page] = &[
|
||||
Page::Main,
|
||||
Page::Patterns,
|
||||
Page::Audio,
|
||||
Page::Engine,
|
||||
Page::Help,
|
||||
Page::Dict,
|
||||
Page::Options,
|
||||
];
|
||||
|
||||
/// Grid dimensions (cols, rows)
|
||||
@@ -24,14 +26,15 @@ impl Page {
|
||||
/// Grid position (col, row) for each page
|
||||
/// Layout:
|
||||
/// col 0 col 1 col 2
|
||||
/// row 0 Patterns Help
|
||||
/// row 1 Dict Sequencer Audio
|
||||
/// row 0 Options Patterns Help
|
||||
/// row 1 Dict Sequencer Engine
|
||||
pub const fn grid_pos(self) -> (i8, i8) {
|
||||
match self {
|
||||
Page::Options => (0, 0),
|
||||
Page::Dict => (0, 1),
|
||||
Page::Main => (1, 1),
|
||||
Page::Patterns => (1, 0),
|
||||
Page::Audio => (2, 1),
|
||||
Page::Engine => (2, 1),
|
||||
Page::Help => (2, 0),
|
||||
}
|
||||
}
|
||||
@@ -46,9 +49,10 @@ impl Page {
|
||||
match self {
|
||||
Page::Main => "Sequencer",
|
||||
Page::Patterns => "Patterns",
|
||||
Page::Audio => "Audio",
|
||||
Page::Engine => "Engine",
|
||||
Page::Help => "Help",
|
||||
Page::Dict => "Dict",
|
||||
Page::Options => "Options",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user