mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
scenes still don't align, though
This commit is contained in:
parent
a79a5c57b3
commit
2433239eaa
1 changed files with 31 additions and 30 deletions
|
|
@ -194,7 +194,7 @@ impl Tek {
|
||||||
) -> impl Content<TuiOut> + 'a {
|
) -> impl Content<TuiOut> + 'a {
|
||||||
Fixed::y(h, Bsp::a(
|
Fixed::y(h, Bsp::a(
|
||||||
Fill::x(Align::w(Fixed::x(self.w_sidebar() as u16, a))),
|
Fill::x(Align::w(Fixed::x(self.w_sidebar() as u16, a))),
|
||||||
Fill::x(Align::c(Fixed::xy(w, h, b)))
|
Fill::x(Align::c(Fixed::x(w, b)))
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
fn view_inputs (&self) -> impl Content<TuiOut> + use<'_> {
|
fn view_inputs (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
|
|
@ -218,13 +218,11 @@ impl Tek {
|
||||||
let rec = false;
|
let rec = false;
|
||||||
let mon = false;
|
let mon = false;
|
||||||
let cells: ThunkBox<_> = per_track!(self.size.w();|self, track, _t|Bsp::s(Tui::bold(true, row!(
|
let cells: ThunkBox<_> = per_track!(self.size.w();|self, track, _t|Bsp::s(Tui::bold(true, row!(
|
||||||
Tui::fg_bg(if rec { White } else { track.color.light.rgb }, track.color.dark.rgb, "Rcrd"),
|
Tui::fg_bg(if rec { White } else { track.color.light.rgb }, track.color.dark.rgb, "Recrd"),
|
||||||
Tui::fg_bg(if rec { White } else { track.color.dark.rgb }, track.color.dark.rgb, "▐"),
|
Tui::fg_bg(if mon { White } else { track.color.light.rgb }, track.color.dark.rgb, "Monit"),
|
||||||
Tui::fg_bg(if mon { White } else { track.color.light.rgb }, track.color.dark.rgb, "Mntr"),
|
|
||||||
)), row!(
|
)), row!(
|
||||||
Tui::fg_bg(if rec { White } else { track.color.light.rgb }, track.color.darker.rgb, "CH**"),
|
Tui::fg_bg(if rec { White } else { track.color.light.rgb }, track.color.darker.rgb, "R▞▞▞▞"),
|
||||||
Tui::fg_bg(if rec { White } else { track.color.dark.rgb }, track.color.darker.rgb, "▐"),
|
Tui::fg_bg(if mon { White } else { track.color.light.rgb }, track.color.darker.rgb, "M▞▞▞▞"),
|
||||||
Tui::fg_bg(if mon { White } else { track.color.light.rgb }, track.color.darker.rgb, "CH**"),
|
|
||||||
)));
|
)));
|
||||||
self.view_row(w, h as u16, header, cells)
|
self.view_row(w, h as u16, header, cells)
|
||||||
}
|
}
|
||||||
|
|
@ -245,13 +243,11 @@ impl Tek {
|
||||||
let mute = false;
|
let mute = false;
|
||||||
let solo = false;
|
let solo = false;
|
||||||
let cells: ThunkBox<_> = per_track!(self.size.w();|self, track, _t|Bsp::s(Tui::bold(true, row!(
|
let cells: ThunkBox<_> = per_track!(self.size.w();|self, track, _t|Bsp::s(Tui::bold(true, row!(
|
||||||
Tui::fg_bg(if mute { White } else { track.color.light.rgb }, track.color.dark.rgb, "Play"),
|
Tui::fg_bg(if mute { White } else { track.color.light.rgb }, track.color.dark.rgb, "Play "),
|
||||||
Tui::fg_bg(if mute { White } else { track.color.dark.rgb }, track.color.dark.rgb, "▐"),
|
Tui::fg_bg(if solo { White } else { track.color.light.rgb }, track.color.dark.rgb, "Solo "),
|
||||||
Tui::fg_bg(if solo { White } else { track.color.light.rgb }, track.color.dark.rgb, "Solo"),
|
|
||||||
)), row!(
|
)), row!(
|
||||||
Tui::fg_bg(if mute { White } else { track.color.light.rgb }, track.color.darker.rgb, "CH**"),
|
Tui::fg_bg(if mute { White } else { track.color.light.rgb }, track.color.darker.rgb, "P▞▞▞▞"),
|
||||||
Tui::fg_bg(if mute { White } else { track.color.darker.rgb }, track.color.darker.rgb, "▐"),
|
Tui::fg_bg(if solo { White } else { track.color.light.rgb }, track.color.darker.rgb, "S▞▞▞▞"),
|
||||||
Tui::fg_bg(if solo { White } else { track.color.light.rgb }, track.color.darker.rgb, "CH**"),
|
|
||||||
)));
|
)));
|
||||||
self.view_row(self.w(), h as u16, header, cells)
|
self.view_row(self.w(), h as u16, header, cells)
|
||||||
}
|
}
|
||||||
|
|
@ -298,11 +294,9 @@ impl Tek {
|
||||||
let scenes = move||self.scenes_sizes(editing, 2, 15);
|
let scenes = move||self.scenes_sizes(editing, 2, 15);
|
||||||
let selected_track = self.selected().track();
|
let selected_track = self.selected().track();
|
||||||
let selected_scene = self.selected().scene();
|
let selected_scene = self.selected().scene();
|
||||||
let border = move|h, cell|Push::y(1, Fixed::y(h, Outer(false, bstyle).enclose(cell)));
|
|
||||||
let header = move||{
|
let header = move||{
|
||||||
let last_color = Arc::new(RwLock::new(ItemPalette::G[0]));
|
let last_color = Arc::new(RwLock::new(ItemPalette::G[0]));
|
||||||
let iter = ||self.scenes_sizes(self.is_editing(), 2, 15);
|
let cell = {
|
||||||
let cell = {
|
|
||||||
let last_color = last_color.clone();
|
let last_color = last_color.clone();
|
||||||
move|i, color: &ItemPalette, name: Arc<str>|phat_sel_3(
|
move|i, color: &ItemPalette, name: Arc<str>|phat_sel_3(
|
||||||
self.selected().scene() == Some(i),
|
self.selected().scene() == Some(i),
|
||||||
|
|
@ -315,18 +309,21 @@ impl Tek {
|
||||||
Some(Reset)
|
Some(Reset)
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
Map::new(iter, move|(_, scene, y1, y2), s| {
|
Map::new(scenes, move|(_, scene, y1, y2), s| {
|
||||||
let cell = cell(s, &scene.color, scene.name.clone());
|
|
||||||
let height = (1 + y2 - y1) as u16;
|
let height = (1 + y2 - y1) as u16;
|
||||||
|
let cell = cell(s, &scene.color, scene.name.clone());
|
||||||
*last_color.write().unwrap() = scene.color;
|
*last_color.write().unwrap() = scene.color;
|
||||||
map_south(y1 as u16, height, border(height, cell))
|
Either(y2 > size_h, (), map_south(y1 as u16, height,
|
||||||
|
Push::y(1, Fixed::y(height, Outer(false, bstyle)
|
||||||
|
.enclose(cell)))))
|
||||||
}).boxed()
|
}).boxed()
|
||||||
};
|
};
|
||||||
let border = move|x|Outer(true, bstyle).enclose_bg(x);
|
|
||||||
let content: ThunkBox<_> = per_track!(self.size.w(); |self, track, t|{
|
let content: ThunkBox<_> = per_track!(self.size.w(); |self, track, t|{
|
||||||
|
let tab = " Tab ";
|
||||||
let last_color = self.fmtd.read().unwrap().last_color.clone();
|
let last_color = self.fmtd.read().unwrap().last_color.clone();
|
||||||
let same_track = selected_track == Some(t+1);
|
let same_track = selected_track == Some(t+1);
|
||||||
border(Map::new(scenes, move|(_, scene, y1, y2), s|{
|
Outer(true, bstyle).enclose_bg(Map::new(scenes, move|(_, scene, y1, y2), s|{
|
||||||
|
let height = (1 + y2 - y1) as u16;
|
||||||
let last_color = last_color.clone();
|
let last_color = last_color.clone();
|
||||||
Thunk::new(move||{
|
Thunk::new(move||{
|
||||||
let last_color = last_color.clone();
|
let last_color = last_color.clone();
|
||||||
|
|
@ -348,11 +345,8 @@ impl Tek {
|
||||||
} else {
|
} else {
|
||||||
Some(last_color.read().unwrap().base.rgb)
|
Some(last_color.read().unwrap().base.rgb)
|
||||||
};
|
};
|
||||||
let mid = if selected { bg.light } else { bg.base }.rgb;
|
let mid = if selected { bg.light } else { bg.base }.rgb;
|
||||||
let low = Some(Reset);
|
|
||||||
let h = (1 + y2 - y1) as u16;
|
|
||||||
*last_color.write().unwrap() = bg;
|
*last_color.write().unwrap() = bg;
|
||||||
let tab = " Tab ";
|
|
||||||
let name = if active {
|
let name = if active {
|
||||||
self.editor.as_ref()
|
self.editor.as_ref()
|
||||||
.map(|e|e.clip().as_ref().map(|c|c.clone()))
|
.map(|e|e.clip().as_ref().map(|c|c.clone()))
|
||||||
|
|
@ -372,11 +366,18 @@ impl Tek {
|
||||||
&self.editor));
|
&self.editor));
|
||||||
let cell = Thunk::new(move||Bsp::a(
|
let cell = Thunk::new(move||Bsp::a(
|
||||||
When::new(selected, Fill::y(Align::n(button(tab, "edit")))),
|
When::new(selected, Fill::y(Align::n(button(tab, "edit")))),
|
||||||
phat_sel_3(selected, Fill::xy(label()), Fill::xy(label()), top, mid, low)));
|
phat_sel_3(
|
||||||
let cell = Either::new(active, editor, cell);
|
selected,
|
||||||
Either(y2 > size_h,
|
Fill::xy(label()),
|
||||||
(),
|
Fill::xy(label()),
|
||||||
map_south(y1 as u16, h, Push::y(1, Fixed::y(h, cell))))
|
top,
|
||||||
|
mid,
|
||||||
|
Some(Reset)
|
||||||
|
)));
|
||||||
|
|
||||||
|
Either(y2 > size_h, (), map_south(y1 as u16, height,
|
||||||
|
Push::y(1, Fixed::y(height, Outer(false, bstyle)
|
||||||
|
.enclose(Either::new(active, editor, cell))))))
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue