Skip to content

Commit

Permalink
Termion major dependency update
Browse files Browse the repository at this point in the history
termion: 2.0 -> 4.0

Other minor and patch updates.
  • Loading branch information
sayanarijit committed Jun 29, 2024
1 parent 19107bc commit eeb94ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tui-input"
version = "0.8.0"
version = "0.9.0"
edition = "2021"
authors = ["Arijit Basu <hi@arijitbasu.in>"]
description = "TUI input library supporting multiple backends"
Expand All @@ -17,9 +17,9 @@ default = ["crossterm"]

[dependencies]
crossterm = { version = "0.27.0", optional = true }
serde = { version = "1.0.183", optional = true, features = ["derive"] }
termion = { version = "2.0.1", optional = true }
unicode-width = "0.1.10"
serde = { version = "1.0.203", optional = true, features = ["derive"] }
termion = { version = "4.0.2", optional = true }
unicode-width = "0.1.13"

[[example]]
name = "crossterm_input"
Expand Down
6 changes: 3 additions & 3 deletions examples/ratatui-input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
crossterm = "0.27.0"
tui = { package = "ratatui", git = "https://github.com/a-kenji/ratatui", branch = "update/crossterm", features = ["crossterm"] }
crossterm = "0.27"
ratatui = "0.27"
tui-input = { path = "../../" }
unicode-width = "0.1.10"
unicode-width = "0.1.13"
9 changes: 4 additions & 5 deletions examples/ratatui-input/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ use crossterm::{
disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen,
},
};
use std::{error::Error, io};
use tui::{
use ratatui::{
backend::{Backend, CrosstermBackend},
layout::{Constraint, Direction, Layout},
style::{Color, Modifier, Style},
text::{Line, Span, Text},
widgets::{Block, Borders, List, ListItem, Paragraph},
Frame, Terminal,
};
use std::{error::Error, io};
use tui_input::backend::crossterm::EventHandler;
use tui_input::Input;

Expand Down Expand Up @@ -103,7 +103,7 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> io::Result<(
}
}

fn ui<B: Backend>(f: &mut Frame<B>, app: &App) {
fn ui(f: &mut Frame, app: &App) {
let chunks = Layout::default()
.direction(Direction::Vertical)
.margin(2)
Expand Down Expand Up @@ -139,8 +139,7 @@ fn ui<B: Backend>(f: &mut Frame<B>, app: &App) {
Style::default(),
),
};
let mut text = Text::from(Line::from(msg));
text.patch_style(style);
let text = Text::from(Line::from(msg)).style(style);
let help_message = Paragraph::new(text);
f.render_widget(help_message, chunks[0]);

Expand Down

0 comments on commit eeb94ed

Please sign in to comment.