mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 20:26:42 +01:00
ui thrashing
This commit is contained in:
parent
acb952736e
commit
20b7267225
18 changed files with 695 additions and 233 deletions
|
|
@ -26,8 +26,9 @@ impl<'a> SceneGridViewVertical<'a> {
|
|||
Color::Reset
|
||||
});
|
||||
if self.focused && self.entered {
|
||||
lozenge_left(self.buf, x, y, height, style);
|
||||
lozenge_right(self.buf, x + width - 1, y, height, style);
|
||||
QuarterV(Style::default().green().dim()).draw(self.buf, Rect { x, y, width, height });
|
||||
//lozenge_left(self.buf, x, y, height, style);
|
||||
//lozenge_right(self.buf, x + width - 1, y, height, style);
|
||||
}
|
||||
let bg_color = if self.focused && self.entered {
|
||||
Color::Rgb(30, 90, 25)
|
||||
|
|
@ -209,8 +210,10 @@ impl<'a> SceneGridViewHorizontal<'a> {
|
|||
Color::Reset
|
||||
});
|
||||
if self.focused && self.entered {
|
||||
lozenge_left(self.buf, x, y, height, style);
|
||||
lozenge_right(self.buf, x + width - 1, y, height, style);
|
||||
//RailV::draw(self.buf, Rect { x, y, width, height });
|
||||
QuarterV(Style::default().green().dim()).draw(self.buf, Rect { x, y, width, height });
|
||||
//lozenge_left(self.buf, x, y, height, style);
|
||||
//lozenge_right(self.buf, x + width - 1, y, height, style);
|
||||
}
|
||||
let mut x2 = 0;
|
||||
self.draw_tracks(&mut x2);
|
||||
|
|
@ -298,3 +301,71 @@ fn longest_scene_name (scenes: &[Scene]) -> u16 {
|
|||
}
|
||||
w
|
||||
}
|
||||
//use crate::core::*;
|
||||
//use crate::view::*;
|
||||
//use crate::model::*;
|
||||
|
||||
//pub fn render (state: &Mixer, buf: &mut Buffer, mut area: Rect)
|
||||
//-> Usually<Rect>
|
||||
//{
|
||||
//if area.height < 2 {
|
||||
//return Ok(area)
|
||||
//}
|
||||
//area.x = area.width.saturating_sub(80) / 2;
|
||||
//area.width = area.width.min(80);
|
||||
//area.height = state.tracks.len() as u16 + 2;
|
||||
//draw_box(buf, area);
|
||||
//let x = area.x + 1;
|
||||
//let y = area.y + 1;
|
||||
//let _h = area.height - 2;
|
||||
//for (i, track) in state.tracks.iter().enumerate() {
|
||||
////buf.set_string(
|
||||
////x, y + index as u16,
|
||||
////&track.name, Style::default().bold().not_dim()
|
||||
////);
|
||||
//for (j, (column, field)) in [
|
||||
//(0, format!(" {:10} ", track.name)),
|
||||
//(12, format!(" {:.1}dB ", track.gain)),
|
||||
//(22, format!(" [ ] ")),
|
||||
//(30, format!(" C ")),
|
||||
//(35, format!(" {:.1}dB ", track.level)),
|
||||
//(45, format!(" [ ] ")),
|
||||
//(51, format!(" {:7} ", track.route)),
|
||||
//].into_iter().enumerate() {
|
||||
//buf.set_string(
|
||||
//x + column as u16,
|
||||
//y + i as u16,
|
||||
//field,
|
||||
//if state.selected_track == i && state.selected_column == j {
|
||||
//Style::default().white().bold().not_dim()
|
||||
//} else {
|
||||
//Style::default().not_dim()
|
||||
//}
|
||||
//);
|
||||
////stdout.queue(move_to(column, row))?;
|
||||
////if state.selected_track == i && state.selected_column == j {
|
||||
////stdout.queue(PrintStyledContent(field.to_string().bold().reverse()))?;
|
||||
////} else {
|
||||
////stdout.queue(PrintStyledContent(field.to_string().bold()))?;
|
||||
////}
|
||||
////fn render_meters (
|
||||
////state: &mut Mixer,
|
||||
////stdout: &mut Stdout,
|
||||
////offset: Rect
|
||||
////) -> Result<(), Box<dyn Error>> {
|
||||
////let move_to = |col, row| crossterm::cursor::MoveTo(offset.0 + col, offset.1 + row);
|
||||
////for (i, track) in state.tracks.iter().enumerate() {
|
||||
////let row = (i + 1) as u16;
|
||||
////stdout
|
||||
////.queue(move_to(10, row))?.queue(PrintStyledContent("▁".green()))?
|
||||
////.queue(move_to(20, row))?.queue(PrintStyledContent("▁".green()))?
|
||||
////.queue(move_to(28, row))?.queue(PrintStyledContent("▁".green()))?
|
||||
////.queue(move_to(43, row))?.queue(PrintStyledContent("▁".green()))?;
|
||||
////}
|
||||
////Ok(())
|
||||
////}
|
||||
//}
|
||||
//}
|
||||
//Ok(area)
|
||||
//}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue