mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
sampler_view: use Map::east/south
This commit is contained in:
parent
09edbbe730
commit
8b0e484114
2 changed files with 16 additions and 5 deletions
|
|
@ -2,10 +2,21 @@ use crate::*;
|
|||
|
||||
impl Sampler {
|
||||
pub fn view_grid (&self) -> impl Content<TuiOut> {
|
||||
let pos = |x|Align::c(Fixed::xy(64, 32, Align::nw(x)));
|
||||
pos(Map::new(||0..8u16, |x, _|Map::new(||0..8u16, move|y, _|{
|
||||
Pull::x(2, Push::xy(x * 5, y * 2, Tui::bg(Color::Black, "SMPL")))
|
||||
})))
|
||||
let cells_x = 8u16;
|
||||
let cells_y = 8u16;
|
||||
let cell_width = 8u16;
|
||||
let cell_height = 2u16;
|
||||
let width = cells_x * cell_width;
|
||||
let height = cells_y * cell_height;
|
||||
let pos = |a|Align::c(Tui::bg(Color::Black, Fixed::xy(width, height, a)));
|
||||
let cell = move|y, _|Fixed::xy(cell_width, cell_height, "x");
|
||||
let rows = move|x, _|Map::south(cell_height, move||0..cells_y, cell);
|
||||
let cols = Map::east(cell_width, move||0..cells_x, rows);
|
||||
pos(cols)
|
||||
//Fixed::xy(cell_width, 2, Bsp::s(
|
||||
//format!("{x}x{y}"),
|
||||
//RepeatH(Phat::<()>::HI),
|
||||
//)))))))))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue