mirror of
https://github.com/ratatui/ratatui.git
synced 2025-10-02 23:35:49 +00:00

Simplified a bunch of the logic in the demo2 example - Moved destroy mode to its own file. - Moved error handling to its own file. - Removed AppContext - Implemented Widget for &App. The app state is small enough that it doesn't matter here and we could just copy or clone the app state on every frame, but for larger apps this can be a significant performance improvement. - Made the tabs stateful - Made the term module just a collection of functions rather than a struct. - Changed to use color_eyre for error handling. - Changed keyboard shortcuts and rearranged the bottom bar. - Use strum for the tabs enum.
23 lines
345 B
Rust
23 lines
345 B
Rust
mod app;
|
|
mod big_text;
|
|
mod colors;
|
|
mod destroy;
|
|
mod errors;
|
|
mod tabs;
|
|
mod term;
|
|
mod theme;
|
|
|
|
pub use app::*;
|
|
use color_eyre::Result;
|
|
pub use colors::*;
|
|
pub use term::*;
|
|
pub use theme::*;
|
|
|
|
fn main() -> Result<()> {
|
|
errors::init_hooks()?;
|
|
let terminal = &mut term::init()?;
|
|
App::new().run(terminal)?;
|
|
term::restore()?;
|
|
Ok(())
|
|
}
|