mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
systematizing jack handlers
This commit is contained in:
parent
d627d257ad
commit
4ae62c5bc2
10 changed files with 342 additions and 208 deletions
|
|
@ -18,6 +18,7 @@ impl Device for Rows {
|
|||
match event {
|
||||
EngineEvent::Input(Event::Key(KeyEvent { code: KeyCode::Esc, .. })) => {
|
||||
self.focused = true;
|
||||
self.items[self.focus].handle(&EngineEvent::Blur)?;
|
||||
Ok(())
|
||||
},
|
||||
_ => self.items[self.focus].handle(event)
|
||||
|
|
@ -39,9 +40,11 @@ impl Device for Rows {
|
|||
},
|
||||
Event::Key(KeyEvent { code: KeyCode::Enter, .. }) => {
|
||||
self.focused = false;
|
||||
self.items[self.focus].handle(&EngineEvent::Focus)?;
|
||||
},
|
||||
Event::Key(KeyEvent { code: KeyCode::Esc, .. }) => {
|
||||
self.focused = true;
|
||||
self.items[self.focus].handle(&EngineEvent::Blur)?;
|
||||
},
|
||||
_ => {
|
||||
println!("{event:?}");
|
||||
|
|
@ -63,7 +66,7 @@ impl Device for Rows {
|
|||
height: area.height - h
|
||||
})?;
|
||||
if self.focused && i == self.focus {
|
||||
draw_box_styled(buf, result, Some(Style::default().gray().bold().not_dim()))
|
||||
draw_box_styled(buf, result, Some(Style::default().green().dim().bold()))
|
||||
}
|
||||
w = w.max(result.width);
|
||||
h = h + result.height;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue