mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-02-21 18:49:04 +01:00
This commit is contained in:
parent
5d61cc6c5f
commit
c1011ddb7f
1 changed files with 8 additions and 0 deletions
|
|
@ -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> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue