mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 22:17:07 +02:00
moar flat
This commit is contained in:
parent
fc01fd6ad3
commit
a27dacff93
29 changed files with 649 additions and 582 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use ::tengri::{
|
||||
*,
|
||||
lang::*,
|
||||
dizzle::*,
|
||||
crossterm::event::{Event::*, KeyEvent, KeyCode::*},
|
||||
ratatui::style::Color,
|
||||
};
|
||||
|
|
@ -20,11 +20,15 @@ tui_view!(self: State {
|
|||
let index = self.cursor + 1;
|
||||
let wh = (self.size.w(), self.size.h());
|
||||
let src = VIEWS.get(self.cursor).unwrap_or(&"");
|
||||
let heading = format!("State {}/{} in {:?}", index, VIEWS.len(), &wh);
|
||||
let title = bg(Color::Rgb(60, 10, 10), heading.align_n().push_xy(2, 1)).exact_h(3);
|
||||
let code = bg(Color::Rgb(10, 60, 10), format!("Source:\n{}", src).align_n().push_xy(2, 1)).min_h(4);
|
||||
let widget = thunk(move|to: &mut Tui|self.interpret(to, &src));
|
||||
self.size.of(east(south(title, code).max_w(40), widget))
|
||||
let heading = format!("Demo [Mode 02]\nExample {}/{}\nSize {:?}", index, VIEWS.len(), &wh);
|
||||
let title = bg(Color::Rgb(60, 10, 10), heading);
|
||||
let code = bg(Color::Rgb(10, 60, 10), format!("Source:\n{}", src).max_h(10));
|
||||
let widget = draw(move|to: &mut Tui|self.interpret(to, &src)); // FIXME this forcefills
|
||||
let sidebar = bg(Color::Rgb(20, 20, 20), north(code, title)).max_w(40);
|
||||
let content = bg(Color::Rgb(64, 64, 64), widget);
|
||||
east(sidebar, content)
|
||||
//self.size.of(bg(Color::Rgb(10, 10, 10), south(east(sidebar, content), code)).full_w())
|
||||
//self.size.of(bg(Color::Rgb(10, 10, 10), east(sidebar, content)).full_w())
|
||||
});
|
||||
|
||||
impl Interpret<Tui, Option<XYWH<u16>>> for State {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue