Skip to content

Commit

Permalink
Fix ratatio deprecated methods
Browse files Browse the repository at this point in the history
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
  • Loading branch information
FedericoBruzzone committed Aug 12, 2024
1 parent ca1a79c commit 21b00e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/example_chat_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ fn ui(f: &mut Frame, app: &mut App) {
let chunks = Layout::default()
.direction(Direction::Horizontal)
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)])
.split(f.size());
.split(f.area());

// Iterate through all elements in the `items` app and append some debug
// text to it.
Expand Down
10 changes: 5 additions & 5 deletions src/components/prompt_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
use arboard::Clipboard;
use crossterm::event::KeyCode;
use ratatui::{
layout::Rect,
layout::{Position, Rect},
symbols::{
border::{Set, PLAIN},
line::NORMAL,
Expand Down Expand Up @@ -865,10 +865,10 @@ impl Component for PromptWindow {
frame.render_widget(input, area);

if self.focused {
frame.set_cursor(
area.x + self.input.cursor_x() as u16 + 1,
area.y + self.input.cursor_y() as u16 + 1,
);
frame.set_cursor_position(Position {
x: area.x + self.input.cursor_x() as u16 + 1,
y: area.y + self.input.cursor_y() as u16 + 1,
});
}
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@ pub async fn handle_app_actions(
match action {
Action::Render => {
tui_backend.terminal.draw(|f| {
tui.draw(f, f.size()).unwrap();
tui.draw(f, f.area()).unwrap();
})?;
}
Action::Resize(width, height) => {
tui_backend
.terminal
.resize(Rect::new(0, 0, width, height))?;
tui_backend.terminal.draw(|f| {
tui.draw(f, f.size()).unwrap();
tui.draw(f, f.area()).unwrap();
})?;
}
Action::Quit => {
Expand Down

0 comments on commit 21b00e5

Please sign in to comment.