mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip: refactor pt.29: 12 errors
This commit is contained in:
parent
ceead4131c
commit
ab85a86b6b
27 changed files with 1890 additions and 1865 deletions
|
|
@ -1,25 +1 @@
|
|||
use crate::*;
|
||||
|
||||
pub trait StatusBar<E: Engine, S>: Widget<Engine = E> {
|
||||
fn hotkey_fg () -> Color where Self: Sized;
|
||||
|
||||
fn update (&mut self, state: &S);
|
||||
|
||||
fn command (commands: &[[impl Widget<Engine = Tui>;3]])
|
||||
-> impl Widget<Engine = Tui> + '_
|
||||
where
|
||||
Self: Sized
|
||||
{
|
||||
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