mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
fix clip heights
This commit is contained in:
parent
3030f28ef7
commit
dff6f1e279
1 changed files with 20 additions and 20 deletions
|
|
@ -502,33 +502,32 @@ impl Tek {
|
|||
let color: ItemPalette = track.color.dark.into();
|
||||
let last_color = Arc::new(RwLock::new(ItemPalette::from(Color::Rgb(0, 0, 0))));
|
||||
map_east(x1 as u16, w, border(Map::new(scenes, move|(_, scene, y1, y2), s| {
|
||||
let last_color = last_color.clone();
|
||||
let h = (1 + y2 - y1) as u16;
|
||||
let color = scene.color;
|
||||
let (name, fg, bg) = if let Some(c) = &scene.clips[t] {
|
||||
let c = c.read().unwrap();
|
||||
(c.name.to_string(), c.color.lightest.rgb, c.color.base.rgb)
|
||||
(c.name.to_string(), c.color.lightest.rgb, c.color)
|
||||
} else {
|
||||
("⏹ ".to_string(), TuiTheme::g(64), TuiTheme::g(32))
|
||||
("⏹ ".to_string(), TuiTheme::g(64), TuiTheme::g(32).into())
|
||||
};
|
||||
let same_track = selected_track == Some(t+1);
|
||||
let selected = same_track && Some(s+1) == selected_scene;
|
||||
let neighbor = same_track && Some(s) == selected_scene;
|
||||
let active = editing && selected;
|
||||
let label = move||Tui::fg(fg, Push::x(1, Tui::bold(true, name.to_string())));
|
||||
let mid = if active { bg.light } else { bg.base };
|
||||
let top = if neighbor { None } else { Some(last_color.read().unwrap().base.rgb) };
|
||||
let mid = mid.rgb;
|
||||
let low = Color::Rgb(0, 0, 0);
|
||||
*last_color.write().unwrap() = bg;
|
||||
map_south(y1 as u16, h, Push::y(1, Fixed::y(h, Either::new(active,
|
||||
Thunk::new(||Bsp::a(
|
||||
Fill::xy(Align::nw(button(" Tab ".into(), "".into()))),
|
||||
&self.editor)),
|
||||
Thunk::new(move||Bsp::a(
|
||||
When::new(selected, Fill::y(Align::n(button(" Tab ".into(), "edit".into())))),
|
||||
phat_sel_3(
|
||||
selected,
|
||||
label(),
|
||||
label(),
|
||||
if neighbor { None } else { Some(bg.into()) },
|
||||
bg.into(),
|
||||
bg.into(),
|
||||
)
|
||||
phat_sel_3(selected, label(), label(), top, mid, low)
|
||||
)),
|
||||
))))
|
||||
}))).boxed()
|
||||
|
|
@ -1119,19 +1118,20 @@ trait HasScenes: HasSelection + HasEditor + Send + Sync {
|
|||
let selected = self.selected().scene();
|
||||
let iter = ||self.scenes_sizes(self.is_editing(), 2, 15);
|
||||
Map::new(iter, move|(_, scene, y1, y2), i| {
|
||||
let h = (1 + y2 - y1) as u16;
|
||||
let name = format!("🭬{}", &scene.name);
|
||||
let color = scene.color;
|
||||
let active = selected == Some(i + 1);
|
||||
let mid = if active { color.light } else { color.base };
|
||||
let top = Some(last_color.read().unwrap().base.rgb);
|
||||
let cell = phat_sel_3(
|
||||
let h = (1 + y2 - y1) as u16;
|
||||
let name = format!("🭬{}", &scene.name);
|
||||
let color = scene.color;
|
||||
let active = selected == Some(i + 1);
|
||||
let neighbor = selected == Some(i);
|
||||
let mid = if active { color.light } else { color.base };
|
||||
let top = if neighbor { None } else { Some(last_color.read().unwrap().base.rgb) };
|
||||
let mid = mid.rgb;
|
||||
let low = Color::Rgb(0, 0, 0);
|
||||
let cell = phat_sel_3(
|
||||
active,
|
||||
Tui::bold(true, name.clone()),
|
||||
Tui::bold(true, name),
|
||||
top,
|
||||
mid.rgb,
|
||||
Color::Rgb(0, 0, 0)
|
||||
top, mid, low
|
||||
);
|
||||
*last_color.write().unwrap() = color;
|
||||
map_south(y1 as u16, h, Push::y(1, Fixed::y(h,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue