retest: 7e, 1f

This commit is contained in:
i do not exist 2026-07-01 16:35:20 +03:00
parent 383e534692
commit c53c5bf377
4 changed files with 29 additions and 21 deletions

View file

@ -23,9 +23,9 @@ pub fn view_logo () -> impl Draw<Tui> {
}
/// ```
/// let x = std::sync::Arc::<std::sync::RwLock<String>>::default();
/// let _ = tek::view_transport(true, x.clone(), x.clone(), x.clone());
/// let _ = tek::view_transport(false, x.clone(), x.clone(), x.clone());
/// let x = "";
/// let _ = tek::view_transport(true, x.as_ref(), x.as_ref(), x.as_ref());
/// let _ = tek::view_transport(false, x.as_ref(), x.as_ref(), x.as_ref());
/// ```
pub fn view_transport (play: bool, bpm: &str, beat: &str, time: &str) -> impl Draw<Tui> {
let theme = ItemTheme::G[96];
@ -40,9 +40,9 @@ pub fn view_transport (play: bool, bpm: &str, beat: &str, time: &str) -> impl Dr
}
/// ```
/// let x = std::sync::Arc::<std::sync::RwLock<String>>::default();
/// let _ = tek::view_status(None, x.clone(), x.clone(), x.clone());
/// let _ = tek::view_status(Some("".into()), x.clone(), x.clone(), x.clone());
/// let x = "";
/// let _ = tek::view_status(None, x.as_ref(), x.as_ref(), x.as_ref());
/// let _ = tek::view_status(Some("".into()), x.as_ref(), x.as_ref(), x.as_ref());
/// ```
pub fn view_status (sel: Option<&str>, sr: &str, buf: &str, lat: &str) -> impl Draw<Tui> {
let theme = ItemTheme::G[96];
@ -569,3 +569,18 @@ pub fn field_h <T: Screen> (theme: ItemTheme, head: impl Draw<T>, body: impl Dra
pub fn field_v <T: Screen> (theme: ItemTheme, head: impl Draw<T>, body: impl Draw<T>) -> impl Draw<T> {
}
pub fn view_sessions () -> impl Draw<Tui> {
let h = 6;
let w = Some(30);
let f = Rgb(224, 192, 128);
h_exact(h, w_min(w, thunk(move |to: &mut Tui|{
for (index, name) in ["session1", "session2", "session3"].iter().enumerate() {
let b = if index == 0 { Rgb(50,50,50) } else { Rgb(40,40,40) };
let y = (2 * index) as u16;
let h = 2;
y_push(y, &h_exact(h, w_full(bg(b, origin_w(fg(f, name)))))).draw(to);
}
Ok(to.area().into())
})))
}