Skip to content

Commit

Permalink
Merge pull request #3 from albinekb/update-ratatui
Browse files Browse the repository at this point in the history
Update ratatui to 0.26.1
  • Loading branch information
TheEmeraldBee authored Mar 9, 2024
2 parents f83c263 + fa54898 commit 30363be
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 16 deletions.
153 changes: 143 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ package.version = "0.0.0"
[dependencies]
anyhow = "1.0.75"
crossterm = "0.27.0"
ratatui = { version = "0.23.0", features = ["macros"] }
tui-helper-proc-macro = { path = "tui-helper-proc-macro", version="0.0.0" }
ratatui = { version = "0.26.1", features = ["macros"] }
tui-helper-proc-macro = { path = "tui-helper-proc-macro", version = "0.0.0" }
6 changes: 3 additions & 3 deletions src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Custom Chunks Example
*/
macro_rules! layout {
($size:expr, $(($($line:tt)*) $(=> { $($row:tt)* })? ),+) => {{
let chunks = Layout::new().direction(Direction::Vertical).constraints([
let chunks = Layout::new(Direction::Vertical, [
$(constraint!($($line)*)),+
]).split($size);

Expand All @@ -34,7 +34,7 @@ macro_rules! layout {
results[i] = vec![chunks[i]];
$(
let row_constraints = layout!(@row $($row)*);
let row = Layout::new().direction(Direction::Horizontal).constraints(
let row = Layout::new(Direction::Horizontal,
row_constraints
).split(chunks[i]);

Expand Down Expand Up @@ -143,7 +143,7 @@ mod test {
(%50)
][1][1];

let popup_test = Rect::new(26, 128, 204, 3);
let popup_test = Rect::new(26, 125, 204, 3);

assert_eq!(popup, popup_test);
}
Expand Down
2 changes: 1 addition & 1 deletion src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crossterm::{
use ratatui::prelude::CrosstermBackend;

pub type WidgetBackend = CrosstermBackend<Stdout>;
pub type WidgetFrame<'a> = ratatui::Frame<'a, CrosstermBackend<Stdout>>;
pub type WidgetFrame<'a> = ratatui::Frame<'a>;
pub type WidgetTerminal = ratatui::Terminal<WidgetBackend>;

/// Sets up the terminal to work with your app
Expand Down

0 comments on commit 30363be

Please sign in to comment.