implement sequencer focus; auto update_focus

This commit is contained in:
🪞👃🪞 2024-10-09 22:50:23 +03:00
parent 9f15f8fff9
commit 3bf475d15e
8 changed files with 119 additions and 160 deletions

View file

@ -1,5 +1,4 @@
use crate::*;
impl TransportToolbar<Tui> {
fn handle_bpm (&mut self, from: &TuiInput) -> Perhaps<bool> {
match from.event() {
@ -28,7 +27,6 @@ impl TransportToolbar<Tui> {
return Ok(Some(true))
}
}
impl Handle<Tui> for TransportToolbar<Tui> {
fn handle (&mut self, from: &TuiInput) -> Perhaps<bool> {
match from.event() {
@ -48,7 +46,6 @@ impl Handle<Tui> for TransportToolbar<Tui> {
Ok(Some(true))
}
}
impl Content for TransportToolbar<Tui> {
type Engine = Tui;
fn content (&self) -> impl Widget<Engine = Tui> {
@ -89,16 +86,6 @@ impl Content for TransportToolbar<Tui> {
).fill_x().bg(Color::Rgb(40, 50, 30))
}
}
impl Focusable<Tui> for TransportToolbar<Tui> {
fn is_focused (&self) -> bool {
self.focused
}
fn set_focused (&mut self, focused: bool) {
self.focused = focused
}
}
impl TransportToolbarFocus {
pub fn wrap <'a, W: Widget<Engine = Tui>> (
self, parent_focus: bool, focus: Self, widget: &'a W