From e122869d901e0f9dd4772a1b8ae9b48a5afa84fe Mon Sep 17 00:00:00 2001 From: Lucas Pickering Date: Fri, 16 Feb 2024 16:26:10 -0500 Subject: [PATCH] Upgrade to ratatui 0.26 --- Cargo.lock | 61 ++++++++++++++++++++++++++++--- Cargo.toml | 2 +- src/tui/view/common/tabs.rs | 8 ++-- src/tui/view/component/primary.rs | 2 +- 4 files changed, 61 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3cb096d..8f3d8061 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -202,6 +202,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" +[[package]] +name = "castaway" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" version = "1.0.83" @@ -301,6 +310,19 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "compact_str" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "ryu", + "static_assertions", +] + [[package]] name = "console" version = "0.15.7" @@ -1256,19 +1278,20 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.25.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5659e52e4ba6e07b2dad9f1158f578ef84a73762625ddb51536019f34d180eb" +checksum = "bcb12f8fbf6c62614b0d56eb352af54f6a22410c3b079eb53ee93c7b97dd31d8" dependencies = [ "bitflags 2.4.1", "cassowary", + "compact_str", "crossterm", "indoc", "itertools", "lru", "paste", "stability", - "strum", + "strum 0.26.1", "unicode-segmentation", "unicode-width", ] @@ -1768,7 +1791,7 @@ dependencies = [ "serde_json_path", "serde_yaml", "signal-hook", - "strum", + "strum 0.25.0", "thiserror", "tokio", "tracing", @@ -1809,6 +1832,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "str-buf" version = "1.0.6" @@ -1827,7 +1856,16 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "strum_macros", + "strum_macros 0.25.3", +] + +[[package]] +name = "strum" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +dependencies = [ + "strum_macros 0.26.1", ] [[package]] @@ -1843,6 +1881,19 @@ dependencies = [ "syn 2.0.41", ] +[[package]] +name = "strum_macros" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.41", +] + [[package]] name = "syn" version = "1.0.109" diff --git a/Cargo.toml b/Cargo.toml index a9d03cc1..aa09d4a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ indexmap = {version = "^2.0.1", features = ["serde"]} itertools = "^0.12.0" nom = "7.1.3" notify = {version = "^6.1.1", default-features = false, features = ["macos_fsevent"]} -ratatui = "^0.25.0" +ratatui = "^0.26.0" reqwest = {version = "^0.11.20", default-features = false, features = ["rustls-tls"]} rmp-serde = "^1.1.2" rusqlite = {version = "^0.30.0", default-features = false, features = ["bundled", "chrono", "uuid"]} diff --git a/src/tui/view/common/tabs.rs b/src/tui/view/common/tabs.rs index 425184f2..1254bae2 100644 --- a/src/tui/view/common/tabs.rs +++ b/src/tui/view/common/tabs.rs @@ -57,11 +57,9 @@ impl EventHandler for Tabs { impl Draw for Tabs { fn draw(&self, frame: &mut Frame, _: (), area: Rect) { frame.render_widget( - ratatui::widgets::Tabs::new( - T::iter().map(|e| e.to_string()).collect(), - ) - .select(self.tabs.selected_index()) - .highlight_style(TuiContext::get().theme.tab_highlight_style), + ratatui::widgets::Tabs::new(T::iter().map(|e| e.to_string())) + .select(self.tabs.selected_index()) + .highlight_style(TuiContext::get().theme.tab_highlight_style), area, ) } diff --git a/src/tui/view/component/primary.rs b/src/tui/view/component/primary.rs index 63135b1f..45f59eb7 100644 --- a/src/tui/view/component/primary.rs +++ b/src/tui/view/component/primary.rs @@ -274,7 +274,7 @@ impl<'a> Draw> for PrimaryView { let [left_area, right_area] = layout( area, Direction::Horizontal, - [Constraint::Max(40), Constraint::Percentage(50)], + [Constraint::Max(40), Constraint::Min(40)], ); // Split left column vertically