mirror of
https://github.com/kristoferssolo/traxor.git
synced 2026-01-14 12:36: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"] }
|
||||
dirs = "6.0"
|
||||
merge = "0.2"
|
||||
ratatui = { version = "0.29" }
|
||||
ratatui = { version = "0.30" }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
thiserror = "2.0"
|
||||
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 {
|
||||
Self { terminal, events }
|
||||
}
|
||||
}
|
||||
|
||||
impl<B: Backend<Error: Send + Sync + 'static>> Tui<B> {
|
||||
/// Initializes the terminal interface.
|
||||
///
|
||||
/// It enables the raw mode and sets terminal properties.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// TODO: add error types
|
||||
/// Returns an error if terminal initialization fails.
|
||||
pub fn init(&mut self) -> Result<()> {
|
||||
terminal::enable_raw_mode()?;
|
||||
crossterm::execute!(io::stderr(), EnterAlternateScreen, EnableMouseCapture)?;
|
||||
@ -63,7 +65,7 @@ impl<B: Backend> Tui<B> {
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// TODO: add error types
|
||||
/// Returns an error if drawing fails.
|
||||
pub fn draw(&mut self, app: &mut App) -> Result<()> {
|
||||
self.terminal.draw(|frame| ui::render(app, frame))?;
|
||||
Ok(())
|
||||
@ -76,7 +78,7 @@ impl<B: Backend> Tui<B> {
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// TODO: add error types
|
||||
/// Returns an error if terminal reset fails.
|
||||
fn reset() -> Result<()> {
|
||||
terminal::disable_raw_mode()?;
|
||||
crossterm::execute!(io::stdout(), LeaveAlternateScreen, DisableMouseCapture)?;
|
||||
@ -89,7 +91,7 @@ impl<B: Backend> Tui<B> {
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// TODO: add error types
|
||||
/// Returns an error if terminal cleanup fails.
|
||||
pub fn exit(&mut self) -> Result<()> {
|
||||
Self::reset()?;
|
||||
self.terminal.show_cursor()?;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user