wip: refactor pt.27: 13 errors

This commit is contained in:
🪞👃🪞 2024-11-14 15:42:13 +01:00
parent 7384950302
commit 4522ebaa4b
4 changed files with 81 additions and 84 deletions

View file

@ -128,47 +128,3 @@ pub enum AppViewFocus<F: std::fmt::Debug + Copy + Clone + PartialEq> {
Menu,
Content(F),
}
impl<A, C> FocusGrid for AppView<Tui, A, C>
where
A: Widget<Engine = Tui> + Handle<Tui> + Audio + FocusGrid,
C: Command<A>
{
type Item = AppViewFocus<<A as FocusGrid>::Item>;
fn cursor (&self) -> (usize, usize) {
self.cursor
}
fn cursor_mut (&mut self) -> &mut (usize, usize) {
&mut self.cursor
}
fn focus_enter (&mut self) {
let focused = self.focused();
if !self.entered {
self.entered = true;
// TODO
}
}
fn focus_exit (&mut self) {
if self.entered {
self.entered = false;
// TODO
}
}
fn entered (&self) -> Option<Self::Item> {
if self.entered {
Some(self.focused())
} else {
None
}
}
fn layout (&self) -> &[&[Self::Item]] {
&[
&[AppViewFocus::Menu],
FocusGrid::layout(&self.ui)
//&[AppViewFocus::Content(())],
]
}
fn update_focus (&mut self) {
// TODO
}
}