Update to ratatui 0.29.0

This commit is contained in:
Erik Kundt
2025-01-14 10:59:21 +01:00
parent 634abc63f8
commit d857d1ead7
10 changed files with 207 additions and 122 deletions
+9 -6
View File
@@ -1,12 +1,12 @@
use std::marker::PhantomData;
use ratatui::widgets::Paragraph;
use ratatui::Frame;
use termion::event::Key;
use ratatui::layout::{Alignment, Constraint, Layout, Rect};
use ratatui::layout::{Alignment, Constraint, Layout, Position, Rect};
use ratatui::style::{Style, Stylize};
use ratatui::text::{Line, Span, Text};
use ratatui::widgets::Paragraph;
use ratatui::Frame;
use crate::ui::theme::Theme;
@@ -287,7 +287,10 @@ where
frame.render_widget(overline, layout[1]);
if props.show_cursor {
frame.set_cursor(top_layout[2].x + cursor_pos, top_layout[2].y)
frame.set_cursor_position(Position::new(
top_layout[2].x + cursor_pos,
top_layout[2].y,
))
}
} else {
let top = Line::from([input].to_vec());
@@ -297,7 +300,7 @@ where
frame.render_widget(bottom, layout[1]);
if props.show_cursor {
frame.set_cursor(area.x + cursor_pos, area.y)
frame.set_cursor_position(Position::new(area.x + cursor_pos, area.y))
}
}
}
@@ -516,7 +519,7 @@ impl<'a, S, M> View for TextArea<'a, S, M> {
(self.textarea.cursor().0, self.textarea.cursor().1),
);
frame.render_widget(self.textarea.widget(), content_area);
frame.render_widget(&self.textarea, content_area);
let mut progress_info = vec![];
+1 -1
View File
@@ -272,7 +272,7 @@ where
.rows(rows)
.widths(widths)
.column_spacing(1)
.highlight_style(style::highlight(render.focus));
.row_highlight_style(style::highlight(render.focus));
let table = if !render.focus && props.dim {
table.dim()
+1 -1
View File
@@ -104,7 +104,7 @@ where
.and_then(|props| props.inner_ref::<WindowProps<Id>>())
.unwrap_or(&default);
let area = frame.size();
let area = frame.area();
let page = props
.current_page