mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
style fixes
This commit is contained in:
parent
1172615d8b
commit
df396f2f83
6 changed files with 49 additions and 49 deletions
|
|
@ -308,19 +308,20 @@ impl Tek {
|
||||||
}
|
}
|
||||||
fn button2 <'a, K, L> (&'a self, key: K, label: L) -> impl Content<TuiOut> + 'a
|
fn button2 <'a, K, L> (&'a self, key: K, label: L) -> impl Content<TuiOut> + 'a
|
||||||
where K: Content<TuiOut> + 'a, L: Content<TuiOut> + 'a {
|
where K: Content<TuiOut> + 'a, L: Content<TuiOut> + 'a {
|
||||||
Tui::bold(true, Bsp::e(
|
let key = Tui::fg_bg(Tui::g(0), Tui::orange(),
|
||||||
Tui::fg_bg(Tui::g(0), Tui::orange(), Bsp::e(key, Tui::fg(Tui::g(96), "▐"))),
|
Bsp::e(Tui::fg_bg(Tui::orange(), Reset, "▐"), Bsp::e(key, Tui::fg(Tui::g(96), "▐"))));
|
||||||
|
Tui::bold(true, Bsp::e(key,
|
||||||
When::new(!self.is_editing(), Tui::fg_bg(Tui::g(255), Tui::g(96), label)))) }
|
When::new(!self.is_editing(), Tui::fg_bg(Tui::g(255), Tui::g(96), label)))) }
|
||||||
fn button3 <'a, K, L, V> (&'a self, key: K, label: L, value: V) -> impl Content<TuiOut> + 'a
|
fn button3 <'a, K, L, V> (&'a self, key: K, label: L, value: V) -> impl Content<TuiOut> + 'a
|
||||||
where K: Content<TuiOut> + 'a, L: Content<TuiOut> + 'a, V: Content<TuiOut> + 'a {
|
where K: Content<TuiOut> + 'a, L: Content<TuiOut> + 'a, V: Content<TuiOut> + 'a {
|
||||||
let editing = self.is_editing();
|
let editing = self.is_editing();
|
||||||
Tui::bold(true, Bsp::e(
|
let key = Tui::fg_bg(Tui::g(0), Tui::orange(),
|
||||||
Tui::fg_bg(Tui::g(0), Tui::orange(), Bsp::e(key, Tui::fg(if editing {
|
Bsp::e(Tui::fg_bg(Tui::orange(), Reset, "▐"), Bsp::e(key, Tui::fg(if editing {
|
||||||
Tui::g(128)
|
Tui::g(128)
|
||||||
} else {
|
} else {
|
||||||
Tui::g(96)
|
Tui::g(96)
|
||||||
}, "▐"))),
|
}, "▐"))));
|
||||||
Bsp::e(
|
Tui::bold(true, Bsp::e(key, Bsp::e(
|
||||||
When::new(!editing, Bsp::e(
|
When::new(!editing, Bsp::e(
|
||||||
Tui::fg_bg(Tui::g(255), Tui::g(96), label),
|
Tui::fg_bg(Tui::g(255), Tui::g(96), label),
|
||||||
Tui::fg_bg(Tui::g(128), Tui::g(96), "▐"),
|
Tui::fg_bg(Tui::g(128), Tui::g(96), "▐"),
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,14 @@ impl Tek {
|
||||||
pub fn view_inputs (&self) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_inputs (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
let w = (self.size.w() as u16).saturating_sub(2 * self.w_sidebar());
|
let w = (self.size.w() as u16).saturating_sub(2 * self.w_sidebar());
|
||||||
let fg = Tui::g(224);
|
let fg = Tui::g(224);
|
||||||
Bsp::s(
|
let routes = self.row_top(w, self.h_inputs() - 1,
|
||||||
Bsp::s(
|
self.io_ports(fg, Tui::g(32), ||self.inputs_sizes()),
|
||||||
self.row_top(w, 1,
|
self.per_track_top(move|t, track|self.io_connections(
|
||||||
|
track.color.dark.rgb,
|
||||||
|
track.color.darker.rgb,
|
||||||
|
||self.inputs_sizes()
|
||||||
|
)));
|
||||||
|
let ports = self.row_top(w, 1,
|
||||||
Fill::x(Align::w(Bsp::e(
|
Fill::x(Align::w(Bsp::e(
|
||||||
self.button3("i", "midi ins", format!("{}", self.midi_ins.len())),
|
self.button3("i", "midi ins", format!("{}", self.midi_ins.len())),
|
||||||
self.button2("I", "add midi in"),
|
self.button2("I", "add midi in"),
|
||||||
|
|
@ -23,15 +28,9 @@ impl Tek {
|
||||||
let bg2 = if t > 0 { self.tracks()[t - 1].color.base.rgb } else { Reset };
|
let bg2 = if t > 0 { self.tracks()[t - 1].color.base.rgb } else { Reset };
|
||||||
Self::wrap(bg, fg, Tui::bold(true, Fill::x(Bsp::e(
|
Self::wrap(bg, fg, Tui::bold(true, Fill::x(Bsp::e(
|
||||||
Tui::fg_bg(rec, bg, "Rec "),
|
Tui::fg_bg(rec, bg, "Rec "),
|
||||||
Tui::fg_bg(mon, bg, "Mon ")))))})),
|
Tui::fg_bg(mon, bg, "Mon ")))))}));
|
||||||
self.row_top(w, self.h_inputs() - 1,
|
Bsp::s(
|
||||||
self.io_ports(fg, Tui::g(32), ||self.inputs_sizes()),
|
Bsp::s(routes, ports),
|
||||||
self.per_track_top(move|t, track|self.io_connections(
|
|
||||||
track.color.dark.rgb,
|
|
||||||
track.color.darker.rgb,
|
|
||||||
||self.inputs_sizes()
|
|
||||||
))),
|
|
||||||
),
|
|
||||||
self.row_top(w, 2,
|
self.row_top(w, 2,
|
||||||
Bsp::s(Align::e("Input:"), Align::e("Into:")),
|
Bsp::s(Align::e("Input:"), Align::e("Into:")),
|
||||||
self.per_track_top(|_, _|Tui::bg(Reset, Align::c(Bsp::s(
|
self.per_track_top(|_, _|Tui::bg(Reset, Align::c(Bsp::s(
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
(fixed/y 2 :toolbar)
|
(fixed/y 2 :toolbar)
|
||||||
(fill/xy (align/c (bsp/a (fill/xy (align/e :pool))
|
(fill/xy (align/c (bsp/a (fill/xy (align/e :pool))
|
||||||
(bsp/a
|
(bsp/a
|
||||||
(fill/xy (align/n (bsp/s :tracks :inputs)))
|
(fill/xy (align/n (bsp/s :inputs :tracks)))
|
||||||
(bsp/a
|
(bsp/a
|
||||||
(fill/xy (align/s :outputs))
|
(fill/xy (align/s :outputs))
|
||||||
(bsp/s :scenes :scene-add)))))))
|
(bsp/s :scenes :scene-add)))))))
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ impl TuiOut {
|
||||||
buffer = engine.write().unwrap().flip(output.buffer, size);
|
buffer = engine.write().unwrap().flip(output.buffer, size);
|
||||||
}
|
}
|
||||||
let t1 = engine.read().unwrap().perf.get_t1(t0).unwrap();
|
let t1 = engine.read().unwrap().perf.get_t1(t0).unwrap();
|
||||||
buffer.set_string(0, 0, &format!("{:>3}.{:>3}ms", t1.as_millis(), t1.as_micros() % 1000), Style::default());
|
//buffer.set_string(0, 0, &format!("{:>3}.{:>3}ms", t1.as_millis(), t1.as_micros() % 1000), Style::default());
|
||||||
std::thread::sleep(timer);
|
std::thread::sleep(timer);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue