mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: refactor pt.9, 403 errors
This commit is contained in:
parent
a784f7a6f2
commit
8aa1ba8d0f
29 changed files with 1008 additions and 902 deletions
19
crates/tek_api/src/status.rs
Normal file
19
crates/tek_api/src/status.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use crate::*;
|
||||
|
||||
pub trait StatusBar<E: Engine>: Widget<Engine = E> {
|
||||
fn hotkey_fg () -> Color;
|
||||
|
||||
fn command (commands: &[[impl Widget<Engine = Tui>;3]]) -> impl Widget<Engine = Tui> + '_ {
|
||||
let hotkey_fg = Self::hotkey_fg();
|
||||
Stack::right(move |add|{
|
||||
Ok(for [a, b, c] in commands.iter() {
|
||||
add(&row!(
|
||||
" ",
|
||||
widget(a),
|
||||
widget(b).bold(true).fg(hotkey_fg),
|
||||
widget(c),
|
||||
))?;
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue