test: button_2, button_3
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
same mf who else 2026-02-21 05:19:59 +02:00
parent 5d61cc6c5f
commit c1011ddb7f

View file

@ -562,12 +562,20 @@ pub fn named_key (token: &str) -> Option<KeyCode> {
}) })
} }
/// ```
/// let _ = button_2("", "", true);
/// let _ = button_2("", "", false);
/// ```
pub fn button_2 <'a> (key: impl Content<TuiOut>, label: impl Content<TuiOut>, editing: bool) -> impl Content<TuiOut> { pub fn button_2 <'a> (key: impl Content<TuiOut>, label: impl Content<TuiOut>, editing: bool) -> impl Content<TuiOut> {
Tui::bold(true, Bsp::e( Tui::bold(true, Bsp::e(
Tui::fg_bg(Tui::orange(), Tui::g(0), Bsp::e(Tui::fg(Tui::g(0), &""), Bsp::e(key, Tui::fg(Tui::g(96), &"")))), Tui::fg_bg(Tui::orange(), Tui::g(0), Bsp::e(Tui::fg(Tui::g(0), &""), Bsp::e(key, Tui::fg(Tui::g(96), &"")))),
When::new(!editing, Tui::fg_bg(Tui::g(255), Tui::g(96), label)))) When::new(!editing, Tui::fg_bg(Tui::g(255), Tui::g(96), label))))
} }
/// ```
/// let _ = button_3("", "", "", true);
/// let _ = button_3("", "", "", false);
/// ```
pub fn button_3 <'a> ( pub fn button_3 <'a> (
key: impl Content<TuiOut>, label: impl Content<TuiOut>, value: impl Content<TuiOut>, editing: bool, key: impl Content<TuiOut>, label: impl Content<TuiOut>, value: impl Content<TuiOut>, editing: bool,
) -> impl Content<TuiOut> { ) -> impl Content<TuiOut> {