mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
flatten workspace into 1 crate
This commit is contained in:
parent
7c4e1e2166
commit
d926422c67
147 changed files with 66 additions and 126 deletions
37
.old/src/app_focus.rs
Normal file
37
.old/src/app_focus.rs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
use crate::*;
|
||||
|
||||
/// Different sections of the UI that may be focused.
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
pub enum AppFocus {
|
||||
/// The transport is selected.
|
||||
Transport,
|
||||
/// The arranger is selected.
|
||||
Arranger,
|
||||
/// The sequencer is selected.
|
||||
Sequencer,
|
||||
/// The device chain is selected.
|
||||
Chain,
|
||||
}
|
||||
|
||||
impl Default for AppFocus {
|
||||
fn default () -> Self { Self::Arranger }
|
||||
}
|
||||
|
||||
impl AppFocus {
|
||||
pub fn prev (&mut self) {
|
||||
*self = match self {
|
||||
Self::Transport => Self::Chain,
|
||||
Self::Arranger => Self::Transport,
|
||||
Self::Sequencer => Self::Arranger,
|
||||
Self::Chain => Self::Sequencer,
|
||||
}
|
||||
}
|
||||
pub fn next (&mut self) {
|
||||
*self = match self {
|
||||
Self::Transport => Self::Arranger,
|
||||
Self::Arranger => Self::Sequencer,
|
||||
Self::Sequencer => Self::Chain,
|
||||
Self::Chain => Self::Transport,
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue