From 765a346de239a959f09bbe2b9fd3d2be18e345cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Fri, 3 Nov 2023 00:22:20 +0100 Subject: [PATCH] Import ratatui explicitly --- Cargo.toml | 2 +- src/main.rs | 6 +++--- src/tui.rs | 6 +++--- src/ui.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 42664b1..a997e36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" [dependencies] crossterm = "0.26.1" -tui = { package = "ratatui", version = "0.24.0" } +ratatui = "0.24.0" diff --git a/src/main.rs b/src/main.rs index e9baa80..cdc5f85 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,10 @@ use {{crate_name}}::app::{App, AppResult}; use {{crate_name}}::event::{Event, EventHandler}; use {{crate_name}}::handler::handle_key_events; -use {{crate_name}}::tui::Tui; +use {{crate_name}}::ratatui::Tui; use std::io; -use tui::backend::CrosstermBackend; -use tui::Terminal; +use ratatui::backend::CrosstermBackend; +use ratatui::Terminal; fn main() -> AppResult<()> { // Create an application. diff --git a/src/tui.rs b/src/tui.rs index 1cd331a..a1c164e 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -5,8 +5,8 @@ use crossterm::event::{DisableMouseCapture, EnableMouseCapture}; use crossterm::terminal::{self, EnterAlternateScreen, LeaveAlternateScreen}; use std::io; use std::panic; -use tui::backend::Backend; -use tui::Terminal; +use ratatui::backend::Backend; +use ratatui::Terminal; /// Representation of a terminal user interface. /// @@ -48,7 +48,7 @@ impl Tui { /// [`Draw`] the terminal interface by [`rendering`] the widgets. /// - /// [`Draw`]: tui::Terminal::draw + /// [`Draw`]: ratatui::Terminal::draw /// [`rendering`]: crate::ui:render pub fn draw(&mut self, app: &mut App) -> AppResult<()> { self.terminal.draw(|frame| ui::render(app, frame))?; diff --git a/src/ui.rs b/src/ui.rs index 840606c..b186502 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -1,4 +1,4 @@ -use tui::{ +use ratatui::{ layout::Alignment, style::{Color, Style}, widgets::{Block, BorderType, Borders, Paragraph},