mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
enter phrase length set mode
This commit is contained in:
parent
83dafe3e81
commit
26d75340f6
3 changed files with 43 additions and 17 deletions
|
|
@ -20,9 +20,12 @@ impl Content for PhrasePool<Tui> {
|
|||
let ticks = length % PPQ;
|
||||
let beats = length % (4 * PPQ);
|
||||
let bars = length / (4 * PPQ);
|
||||
let row1 = lay!(
|
||||
format!(" {i}").align_w().fill_x(),
|
||||
format!("{bars}.{beats}.{ticks:>02} ").align_e().fill_x(),
|
||||
let row1 = lay!(format!(" {i}").align_w().fill_x(),
|
||||
if let Some(PhrasePoolMode::Length(phrase, length, focus)) = self.mode {
|
||||
PhraseLength::new(length, Some(focus))
|
||||
} else {
|
||||
PhraseLength::new(length, None)
|
||||
}.align_e().fill_x()
|
||||
).fill_x();
|
||||
let row2 = if let Some(PhrasePoolMode::Rename(phrase, _)) = self.mode {
|
||||
if self.focused && i == phrase {
|
||||
|
|
@ -327,26 +330,26 @@ impl Content for PhraseLength<Tui> {
|
|||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
Layers::new(move|add|{
|
||||
match (self.focused, &self.focus) {
|
||||
(false, _) => add(&row!(
|
||||
match self.focus {
|
||||
None => add(&row!(
|
||||
" ", self.bars_string(),
|
||||
".", self.beats_string(),
|
||||
".", self.ticks_string(),
|
||||
" "
|
||||
)),
|
||||
(true, PhraseLengthFocus::Bar) => add(&row!(
|
||||
Some(PhraseLengthFocus::Bar) => add(&row!(
|
||||
"[", self.bars_string(),
|
||||
"]", self.beats_string(),
|
||||
".", self.ticks_string(),
|
||||
" "
|
||||
)),
|
||||
(true, PhraseLengthFocus::Beat) => add(&row!(
|
||||
Some(PhraseLengthFocus::Beat) => add(&row!(
|
||||
" ", self.bars_string(),
|
||||
"[", self.beats_string(),
|
||||
"]", self.ticks_string(),
|
||||
" "
|
||||
)),
|
||||
(true, PhraseLengthFocus::Tick) => add(&row!(
|
||||
Some(PhraseLengthFocus::Tick) => add(&row!(
|
||||
" ", self.bars_string(),
|
||||
".", self.beats_string(),
|
||||
"[", self.ticks_string(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue