mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
wip: refactor pt.27: 13 errors
This commit is contained in:
parent
7384950302
commit
4522ebaa4b
4 changed files with 81 additions and 84 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue