mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
simplify
This commit is contained in:
parent
d7bbc2a412
commit
e3a3962130
15 changed files with 74 additions and 81 deletions
|
|
@ -58,10 +58,10 @@ impl App {
|
|||
Fixed::xy(70, 23, Tui::fg_bg(Rgb(255,255,255), Rgb(16,16,16), Bsp::b(
|
||||
Repeat(" "), Outer(true, Style::default().fg(Tui::g(96)))
|
||||
.enclose(self.dialog.as_ref().map(|dialog|match dialog {
|
||||
Dialog::Menu =>
|
||||
Dialog::Menu(_) =>
|
||||
self.view_dialog_menu().boxed(),
|
||||
Dialog::Help =>
|
||||
self.view_dialog_help().boxed(),
|
||||
Dialog::Help(offset) =>
|
||||
self.view_dialog_help(*offset).boxed(),
|
||||
Dialog::Save(browser) =>
|
||||
self.view_dialog_save().boxed(),
|
||||
Dialog::Load(browser) =>
|
||||
|
|
@ -84,12 +84,13 @@ impl App {
|
|||
let option = |a,i|Tui::fg(Rgb(255,255,255), format!("{}", a));
|
||||
Bsp::s(Tui::bold(true, "tek!"), Bsp::s("", Map::south(1, options, option)))
|
||||
}
|
||||
pub fn view_dialog_help <'a> (&'a self) -> impl Content<TuiOut> + use<'a> {
|
||||
pub fn view_dialog_help <'a> (&'a self, offset: usize) -> impl Content<TuiOut> + use<'a> {
|
||||
Bsp::s(Tui::bold(true, "Help"), Bsp::s("", Map::south(1,
|
||||
||self.config.keys.layers.iter()
|
||||
move||self.config.keys.layers.iter()
|
||||
.filter_map(|a|(a.0)(self).then_some(a.1))
|
||||
.flat_map(|a|a)
|
||||
.filter_map(|x|if let Value::Exp(_, iter)=x.value{ Some(iter) } else { None })
|
||||
.skip(offset)
|
||||
.take(20),
|
||||
|mut b,i|Fixed::x(60, Align::w(Bsp::e("(", Bsp::e(
|
||||
b.next().map(|t|Fixed::x(16, Align::w(Tui::fg(Rgb(64,224,0), format!("{}", t.value))))),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue