Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
micielski committed Aug 19, 2024
1 parent 5d03353 commit 3abacfa
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 108 deletions.
195 changes: 102 additions & 93 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ tokio-util = "0.7"
futures = "0.3"

# TUI
crossterm = { version = "0.27", features = ["event-stream", "serde"] }
ratatui = { version = "0.27", features = ["serde"] }
tui-input = "0.9"
tui-tree-widget = "0.21"
throbber-widgets-tui = "0.6.0"
crossterm = { version = "0.28", features = ["event-stream", "serde"] }
ratatui = { version = "0.28", features = ["serde"] }
tui-input = "0.10"
tui-tree-widget = "0.22"
throbber-widgets-tui = "0.7"

# Config for 'cargo dist'
[workspace.metadata.dist]
Expand Down
2 changes: 1 addition & 1 deletion rm-main/src/tui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl App {

fn render(&mut self, tui: &mut Tui) -> Result<()> {
tui.terminal.draw(|f| {
self.main_window.render(f, f.size());
self.main_window.render(f, f.area());
})?;
Ok(())
}
Expand Down
6 changes: 5 additions & 1 deletion rm-main/src/tui/components/input_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ impl Component for InputManager {
f.render_widget(paragraph, rect);

let cursor_offset = self.input.visual_cursor() + prefix_len;
f.set_cursor(rect.x + u16::try_from(cursor_offset).unwrap(), rect.y);
let cursor_position = Position {
x: rect.x + u16::try_from(cursor_offset).unwrap(),
y: rect.y,
};
f.set_cursor_position(cursor_position);
}
}
2 changes: 1 addition & 1 deletion rm-main/src/tui/global_popups/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl Component for ErrorPopup {
}

fn render(&mut self, f: &mut Frame, _rect: Rect) {
let centered_rect = centered_rect(f.size(), 50, 50);
let centered_rect = centered_rect(f.area(), 50, 50);
let popup_rect = centered_rect.inner(Margin::new(1, 1));
let text_rect = popup_rect.inner(Margin::new(3, 2));
let button_rect = Layout::vertical([Constraint::Percentage(100), Constraint::Length(1)])
Expand Down
2 changes: 1 addition & 1 deletion rm-main/src/tui/main_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl Component for MainWindow {
CurrentTab::Search => self.search_tab.render(f, main_window),
}

self.global_popup_manager.render(f, f.size());
self.global_popup_manager.render(f, f.area());
}
}

Expand Down
11 changes: 6 additions & 5 deletions rm-main/src/tui/tabs/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,11 @@ impl Component for SearchTab {
f.render_widget(paragraph, search_rect);

let cursor_offset = self.input.visual_cursor() + prefix_len;
f.set_cursor(
search_rect.x + u16::try_from(cursor_offset).unwrap(),
search_rect.y,
);
let cursor_position = Position {
x: search_rect.x + u16::try_from(cursor_offset).unwrap(),
y: search_rect.y,
};
f.set_cursor_position(cursor_position);

let header = Row::new(["S", "Title", "Size"]);

Expand Down Expand Up @@ -421,7 +422,7 @@ impl Component for SearchTab {
f.render_stateful_widget(table, rest, &mut self.table.state.borrow_mut());

self.bottom_bar.render(f, bottom_line);
self.popup_manager.render(f, f.size());
self.popup_manager.render(f, f.area());
}
}

Expand Down
2 changes: 1 addition & 1 deletion rm-main/src/tui/tabs/torrents/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Component for TorrentsTab {

self.task_manager.render(f, stats_rect);

self.popup_manager.render(f, f.size());
self.popup_manager.render(f, f.area());
}

fn handle_actions(&mut self, action: Action) -> ComponentAction {
Expand Down

0 comments on commit 3abacfa

Please sign in to comment.