mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
wip: generic layout!
This commit is contained in:
parent
0bbf74e915
commit
93ba611e33
11 changed files with 267 additions and 82 deletions
|
|
@ -25,10 +25,11 @@ pub struct Tui {
|
|||
area: Rect,
|
||||
}
|
||||
impl Engine for Tui {
|
||||
type Unit = u16;
|
||||
type HandleInput = Self;
|
||||
type Handled = bool;
|
||||
type Handled = bool;
|
||||
type RenderInput = Self;
|
||||
type Rendered = Rect;
|
||||
type Rendered = Rect;
|
||||
fn exited (&self) -> bool {
|
||||
self.exited.fetch_and(true, Ordering::Relaxed)
|
||||
}
|
||||
|
|
@ -46,12 +47,6 @@ impl Engine for Tui {
|
|||
stdout().execute(LeaveAlternateScreen)?;
|
||||
disable_raw_mode().map_err(Into::into)
|
||||
}
|
||||
fn handle (&self, _: &mut impl Handle<Self>) -> Usually<()> {
|
||||
Ok(())
|
||||
}
|
||||
fn render (&mut self, _: &impl Render<Self>) -> Usually<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
impl Tui {
|
||||
/// Run the main loop.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue