mirror of
https://github.com/kristoferssolo/traxor.git
synced 2026-01-14 20:46:14 +00:00
chore: bump ratatui version
This commit is contained in:
parent
d352c95221
commit
3bbb1459f2
836
Cargo.lock
generated
836
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@ crossterm = "0.29"
|
|||||||
derive_more = { version = "2.1", features = ["display"] }
|
derive_more = { version = "2.1", features = ["display"] }
|
||||||
dirs = "6.0"
|
dirs = "6.0"
|
||||||
merge = "0.2"
|
merge = "0.2"
|
||||||
ratatui = { version = "0.29" }
|
ratatui = { version = "0.30" }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
thiserror = "2.0"
|
thiserror = "2.0"
|
||||||
tokio = { version = "1", features = ["macros", "rt-multi-thread", "fs"] }
|
tokio = { version = "1", features = ["macros", "rt-multi-thread", "fs"] }
|
||||||
|
|||||||
10
src/tui.rs
10
src/tui.rs
@ -27,14 +27,16 @@ impl<B: Backend> Tui<B> {
|
|||||||
pub const fn new(terminal: Terminal<B>, events: EventHandler) -> Self {
|
pub const fn new(terminal: Terminal<B>, events: EventHandler) -> Self {
|
||||||
Self { terminal, events }
|
Self { terminal, events }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<B: Backend<Error: Send + Sync + 'static>> Tui<B> {
|
||||||
/// Initializes the terminal interface.
|
/// Initializes the terminal interface.
|
||||||
///
|
///
|
||||||
/// It enables the raw mode and sets terminal properties.
|
/// It enables the raw mode and sets terminal properties.
|
||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// TODO: add error types
|
/// Returns an error if terminal initialization fails.
|
||||||
pub fn init(&mut self) -> Result<()> {
|
pub fn init(&mut self) -> Result<()> {
|
||||||
terminal::enable_raw_mode()?;
|
terminal::enable_raw_mode()?;
|
||||||
crossterm::execute!(io::stderr(), EnterAlternateScreen, EnableMouseCapture)?;
|
crossterm::execute!(io::stderr(), EnterAlternateScreen, EnableMouseCapture)?;
|
||||||
@ -63,7 +65,7 @@ impl<B: Backend> Tui<B> {
|
|||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// TODO: add error types
|
/// Returns an error if drawing fails.
|
||||||
pub fn draw(&mut self, app: &mut App) -> Result<()> {
|
pub fn draw(&mut self, app: &mut App) -> Result<()> {
|
||||||
self.terminal.draw(|frame| ui::render(app, frame))?;
|
self.terminal.draw(|frame| ui::render(app, frame))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -76,7 +78,7 @@ impl<B: Backend> Tui<B> {
|
|||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// TODO: add error types
|
/// Returns an error if terminal reset fails.
|
||||||
fn reset() -> Result<()> {
|
fn reset() -> Result<()> {
|
||||||
terminal::disable_raw_mode()?;
|
terminal::disable_raw_mode()?;
|
||||||
crossterm::execute!(io::stdout(), LeaveAlternateScreen, DisableMouseCapture)?;
|
crossterm::execute!(io::stdout(), LeaveAlternateScreen, DisableMouseCapture)?;
|
||||||
@ -89,7 +91,7 @@ impl<B: Backend> Tui<B> {
|
|||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
/// TODO: add error types
|
/// Returns an error if terminal cleanup fails.
|
||||||
pub fn exit(&mut self) -> Result<()> {
|
pub fn exit(&mut self) -> Result<()> {
|
||||||
Self::reset()?;
|
Self::reset()?;
|
||||||
self.terminal.show_cursor()?;
|
self.terminal.show_cursor()?;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user