diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2023-12-09 19:14:11 +0100 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2023-12-09 19:14:11 +0100 |
commit | af2aa61813578ecc9f6ccaba5e94049fc6ddf727 (patch) | |
tree | 018265e505f59cbb001520dcbb709e4c172ded39 /src/interactive/widgets/help.rs | |
parent | 852ee281ca89cb58cf404e8179d4e590f6da87b7 (diff) |
upgrade to latest crossterm; switch to `ratatui` from `tui`
Diffstat (limited to 'src/interactive/widgets/help.rs')
-rw-r--r-- | src/interactive/widgets/help.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/interactive/widgets/help.rs b/src/interactive/widgets/help.rs index 82d3725..1f43025 100644 --- a/src/interactive/widgets/help.rs +++ b/src/interactive/widgets/help.rs @@ -5,7 +5,7 @@ use tui::{ buffer::Buffer, layout::Rect, style::{Color, Modifier, Style}, - text::{Span, Spans, Text}, + text::{Line, Span, Text}, widgets::{Block, Borders, Paragraph, Widget}, }; use tui_react::{ @@ -50,16 +50,16 @@ impl HelpPane { pub fn render(&mut self, props: impl Borrow<HelpPaneProps>, area: Rect, buf: &mut Buffer) { let lines = { - let lines = RefCell::new(Vec::<Spans>::with_capacity(30)); + let lines = RefCell::new(Vec::<Line>::with_capacity(30)); let add_newlines = |n| { for _ in 0..n { - lines.borrow_mut().push(Spans::from(Span::raw(""))) + lines.borrow_mut().push(Line::from(Span::raw(""))) } }; let spacer = || add_newlines(2); let title = |name: &str| { - lines.borrow_mut().push(Spans::from(Span::styled( + lines.borrow_mut().push(Line::from(Span::styled( name.to_string(), Style { add_modifier: Modifier::BOLD | Modifier::UNDERLINED, @@ -71,7 +71,7 @@ impl HelpPane { let hotkey = |keys, description, other_line: Option<&str>| { let separator_size = 3; let column_size = 11 + separator_size; - lines.borrow_mut().push(Spans::from(vec![ + lines.borrow_mut().push(Line::from(vec![ Span::styled( format!( "{:>column_size$}", @@ -86,7 +86,7 @@ impl HelpPane { Span::from(format!(" => {}", description)), ])); if let Some(second_line) = other_line { - lines.borrow_mut().push(Spans::from(Span::from(format!( + lines.borrow_mut().push(Line::from(Span::from(format!( "{:>column_size$}{}", "", second_line, |