diff --git a/Cargo.lock b/Cargo.lock index 01d7e8c..2de7d6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -302,13 +302,14 @@ checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "compact_str" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +checksum = "6050c3a16ddab2e412160b31f2c871015704239bca62f72f6e5f0be631d3f644" dependencies = [ "castaway", "cfg-if", "itoa", + "rustversion", "ryu", "static_assertions", ] @@ -340,15 +341,15 @@ dependencies = [ [[package]] name = "crossterm" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ "bitflags", "crossterm_winapi", - "libc", - "mio 0.8.11", + "mio", "parking_lot", + "rustix", "signal-hook", "signal-hook-mio", "winapi", @@ -625,6 +626,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "instability" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -707,18 +718,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.48.0", -] - [[package]] name = "mio" version = "1.0.1" @@ -727,6 +726,7 @@ checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ "hermit-abi", "libc", + "log", "wasi", "windows-sys 0.52.0", ] @@ -902,18 +902,18 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" +checksum = "5ba6a365afbe5615999275bea2446b970b10a41102500e27ce7678d50d978303" dependencies = [ "bitflags", "cassowary", "compact_str", "crossterm", + "instability", "itertools", "lru", "paste", - "stability", "strum", "strum_macros", "unicode-segmentation", @@ -924,7 +924,7 @@ dependencies = [ [[package]] name = "ratatui-binary-data-widget" version = "0.1.0" -source = "git+https://github.com/EdJoPaTo/ratatui-binary-data-widget?branch=ratatui-v0.27#2644c0b93e4a5de4c6e93aed8f55a2ad7b40e5cd" +source = "git+https://github.com/EdJoPaTo/ratatui-binary-data-widget?branch=ratatui-v0.28#02d1c9bca23a2d26048a9bc55fa382a1e78c6cc0" dependencies = [ "ratatui", ] @@ -1210,7 +1210,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", - "mio 0.8.11", + "mio", "signal-hook", ] @@ -1257,16 +1257,6 @@ dependencies = [ "lock_api", ] -[[package]] -name = "stability" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -1372,7 +1362,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.1", + "mio", "pin-project-lite", "socket2", "tokio-macros", @@ -1434,9 +1424,9 @@ dependencies = [ [[package]] name = "tui-tree-widget" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ac69db35529be6a75f9d27516ff33df299e2e8e961a1986d52185cef0427352" +checksum = "df0b54061d997162f225bed5d2147574af0648480214759a000e33f6cea0017a" dependencies = [ "ratatui", "unicode-width", diff --git a/Cargo.toml b/Cargo.toml index 949be41..b812ef7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -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 diff --git a/src/interactive/clean_retained.rs b/src/interactive/clean_retained.rs index 208668f..25a20cb 100644 --- a/src/interactive/clean_retained.rs +++ b/src/interactive/clean_retained.rs @@ -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); diff --git a/src/interactive/footer.rs b/src/interactive/footer.rs index 12a8ac3..c9f85d8 100644 --- a/src/interactive/footer.rs +++ b/src/interactive/footer.rs @@ -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; @@ -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 diff --git a/src/interactive/mod.rs b/src/interactive/mod.rs index 5ff8ca3..9ca00a7 100644 --- a/src/interactive/mod.rs +++ b/src/interactive/mod.rs @@ -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; @@ -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");