Skip to content

Commit

Permalink
fixed termion ratatui demo
Browse files Browse the repository at this point in the history
  • Loading branch information
purephantom committed Jul 20, 2023
1 parent 7ac8adb commit c3ef34e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ travis-ci = { repository = "gin66/tui-logger" }
log = "0.4"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
tui = { version = "0.19", default-features = false, package = "tui", optional = true }
ratatui = { version = "0.22", default-features = false, package = "ratatui", optional = true }
ratatui = { version = "0.22.0", default-features = false, package = "ratatui", optional = true }
tracing = {version = "0.1.37", optional = true}
tracing-subscriber = {version = "0.3", optional = true}
lazy_static = "1.0"
Expand All @@ -33,6 +33,6 @@ env_logger = "0.10.0"
default = ["tui","tui/termion"]
tui-rs = ["tui"]
slog-support = ["slog"]
ratatui-support = ["ratatui"]
ratatui-support = ["ratatui","ratatui/termion"]
tracing-support = ["tracing", "tracing-subscriber"]

8 changes: 4 additions & 4 deletions examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ use termion::{
use ratatui::prelude::*;
#[cfg(feature = "ratatui-support")]
use ratatui::widgets::*;

#[cfg(feature = "ratatui-support")]
use ratatui::backend::CrosstermBackend as SelectedBackend;
use ratatui::backend::TermionBackend;

#[cfg(not(feature = "ratatui-support"))]
use tui::backend::Backend;
#[cfg(not(feature = "ratatui-support"))]
use tui::backend::TermionBackend as SelectedBackend;
use tui::backend::TermionBackend;
#[cfg(not(feature = "ratatui-support"))]
use tui::layout::{Constraint, Direction, Layout, Rect};
#[cfg(not(feature = "ratatui-support"))]
Expand All @@ -33,6 +32,7 @@ use tui::widgets::{Block, Borders, Gauge, Tabs};
use tui::Frame;
#[cfg(not(feature = "ratatui-support"))]
use tui::Terminal;

use tui_logger::*;

struct App {
Expand Down Expand Up @@ -73,7 +73,7 @@ fn main() -> std::result::Result<(), std::io::Error> {
let stdout = io::stdout().into_raw_mode().unwrap();
let stdout = MouseTerminal::from(stdout);
let stdout = AlternateScreen::from(stdout);
SelectedBackend::new(stdout)
TermionBackend::new(stdout)
};

let mut terminal = Terminal::new(backend).unwrap();
Expand Down

0 comments on commit c3ef34e

Please sign in to comment.