arranger: spawning clips once again!1

This commit is contained in:
🪞👃🪞 2025-05-17 12:22:43 +03:00
parent b663c53b0a
commit 48603e4812
6 changed files with 41 additions and 18 deletions

View file

@ -207,8 +207,12 @@ pub trait TracksView: HasSize<TuiOut> + HasTrackScroll + HasSelection + HasMidiI
.tracks_with_sizes(&self.selection(), None)
.skip(self.track_scroll())
{
(add)(&Fixed::x(track.width as u16,
Tui::bg(track.color.base.rgb, Align::nw(Tui::fg(
add(&Fixed::x(track.width as u16,
Tui::bg(if self.selection().track() == Some(index) {
track.color.light.rgb
} else {
track.color.base.rgb
}, Align::nw(Tui::fg(
Rgb(255, 255, 255), Tui::bold(true,
format!("{}", track.name)))))));
}
@ -424,18 +428,23 @@ pub trait ClipsView: TracksView + ScenesView + Send + Sync {
(None, ItemTheme::G[32])
};
let fg = theme.lightest.rgb;
let mut outline = theme.base.rgb;
let bg = if self.selection().track() == Some(track_index)
&& self.selection().scene() == Some(scene_index)
{
outline = theme.lightest.rgb;
theme.light.rgb
} else if self.selection().track() == Some(track_index)
|| self.selection().scene() == Some(scene_index)
{
outline = theme.darkest.rgb;
theme.base.rgb
} else {
theme.dark.rgb
};
cell(&Fixed::xy(track.width as u16, 2, Tui::fg_bg(fg, bg, Align::nw(name.unwrap_or(" ---- ".into())))));
cell(&Fixed::xy(track.width as u16, 2, Bsp::b(
Fill::xy(Outer(true, Style::default().fg(outline))),
Fill::xy(Align::nw(Tui::fg_bg(fg, bg, Align::nw(name.unwrap_or(" ---- ".into()))))))));
//let (name, theme) = if let Some(clip) = &scene.clips.get(track_index).flatten() {
//let clip = clip.read().unwrap();
//(Some(clip.name.clone()), clip.color)