Skip to content

Commit

Permalink
build: update to ratatui v0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Aug 7, 2024
1 parent 9425539 commit b968aed
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 45 deletions.
62 changes: 26 additions & 36 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ chrono = { version = "0.4", default-features = false, features = ["clock", "serd
clap = { version = "4", features = ["deprecated", "derive", "env", "wrap_help"] }
ego-tree = "0.6"
rand = "0.8"
ratatui = "0.27"
ratatui-binary-data-widget = { git = "https://github.com/EdJoPaTo/ratatui-binary-data-widget", branch = "ratatui-v0.27" }
ratatui = "0.28"
ratatui-binary-data-widget = { git = "https://github.com/EdJoPaTo/ratatui-binary-data-widget", branch = "ratatui-v0.28" }
rmpv = { version = "1", features = ["with-serde"] }
rumqttc = { version = "0.24", features = ["websocket"] }
rustls = "0.22"
Expand All @@ -43,7 +43,7 @@ rustls-pemfile = "2"
rustls-pki-types = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tui-tree-widget = "0.21"
tui-tree-widget = "0.22"
url = "2"

# https://crates.io/crates/cargo-deb
Expand Down
2 changes: 1 addition & 1 deletion src/interactive/clean_retained.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn draw_popup(frame: &mut Frame, topic: &str) {
Line::raw("Confirm with Enter, abort with Esc"),
];
let text = Text::from(text);
let area = popup_area(frame.size(), text.width());
let area = popup_area(frame.area(), text.width());
let paragraph = Paragraph::new(text)
.block(block)
.alignment(Alignment::Center);
Expand Down
4 changes: 2 additions & 2 deletions src/interactive/footer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ratatui::layout::Rect;
use ratatui::layout::{Position, Rect};
use ratatui::style::{Color, Modifier, Style};
use ratatui::text::{Line, Span};
use ratatui::Frame;
Expand Down Expand Up @@ -95,7 +95,7 @@ impl Footer {
#[allow(clippy::cast_possible_truncation)]
if matches!(app.focus, ElementInFocus::TopicSearch) {
let x = area.left().saturating_add(keys.width() as u16);
frame.set_cursor(x, area.y);
frame.set_cursor_position(Position { x, y: area.y });
}

// Show version / broker when enough space
Expand Down
5 changes: 2 additions & 3 deletions src/interactive/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use std::time::{Duration, Instant};

use ratatui::backend::{Backend, CrosstermBackend};
use ratatui::crossterm::event::{
Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers, MouseButton, MouseEventKind,
};
use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEventKind};
use ratatui::backend::{Backend, CrosstermBackend};
use ratatui::layout::{Alignment, Position, Rect};
use ratatui::text::Span;
use ratatui::widgets::Paragraph;
Expand Down Expand Up @@ -619,7 +618,7 @@ impl App {

let connection_error = self.mqtt_thread.has_connection_err();

let area = frame.size();
let area = frame.area();
let Rect { width, height, .. } = area;
debug_assert_eq!(area.x, 0, "area should fill the whole space");
debug_assert_eq!(area.y, 0, "area should fill the whole space");
Expand Down

0 comments on commit b968aed

Please sign in to comment.