Skip to content

Commit 2b39c64

Browse files
committed
ratatui 0.24 update
1 parent 45c34e5 commit 2b39c64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+168
-337
lines changed

Cargo.lock

Lines changed: 60 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ log = "0.4"
3636
notify = "6.1"
3737
notify-debouncer-mini = "0.4"
3838
once_cell = "1"
39-
ratatui = { version = "0.23", default-features = false, features = [
39+
ratatui = { version = "0.24", default-features = false, features = [
4040
'crossterm',
4141
'serde',
4242
] }

src/app.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ use asyncgit::{
4242
use crossbeam_channel::Sender;
4343
use crossterm::event::{Event, KeyEvent};
4444
use ratatui::{
45-
backend::Backend,
4645
layout::{
4746
Alignment, Constraint, Direction, Layout, Margin, Rect,
4847
},
@@ -227,7 +226,7 @@ impl App {
227226
}
228227

229228
///
230-
pub fn draw<B: Backend>(&self, f: &mut Frame<B>) -> Result<()> {
229+
pub fn draw(&self, f: &mut Frame) -> Result<()> {
231230
let fsize = f.size();
232231

233232
self.cmdbar.borrow_mut().refresh_width(fsize.width);
@@ -1070,7 +1069,7 @@ impl App {
10701069
}
10711070

10721071
//TODO: make this dynamic
1073-
fn draw_top_bar<B: Backend>(&self, f: &mut Frame<B>, r: Rect) {
1072+
fn draw_top_bar(&self, f: &mut Frame, r: Rect) {
10741073
const DIVIDER_PAD_SPACES: usize = 2;
10751074
const SIDE_PADS: usize = 2;
10761075
const MARGIN_LEFT_AND_RIGHT: usize = 2;

src/cmdbar.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::{
33
ui::style::SharedTheme,
44
};
55
use ratatui::{
6-
backend::Backend,
76
layout::{Alignment, Rect},
87
text::{Line, Span},
98
widgets::Paragraph,
@@ -139,7 +138,7 @@ impl CommandBar {
139138
}
140139
}
141140

142-
pub fn draw<B: Backend>(&self, f: &mut Frame<B>, r: Rect) {
141+
pub fn draw(&self, f: &mut Frame, r: Rect) {
143142
if r.width < MORE_WIDTH {
144143
return;
145144
}

src/components/changes.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use asyncgit::{
1717
StatusItem, StatusItemType,
1818
};
1919
use crossterm::event::Event;
20-
use ratatui::{backend::Backend, layout::Rect, Frame};
20+
use ratatui::{layout::Rect, Frame};
2121
use std::path::Path;
2222

2323
///
@@ -187,11 +187,7 @@ impl ChangesComponent {
187187
}
188188

189189
impl DrawableComponent for ChangesComponent {
190-
fn draw<B: Backend>(
191-
&self,
192-
f: &mut Frame<B>,
193-
r: Rect,
194-
) -> Result<()> {
190+
fn draw(&self, f: &mut Frame, r: Rect) -> Result<()> {
195191
self.files.draw(f, r)?;
196192

197193
Ok(())

src/components/commit_details/compare_details.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use asyncgit::sync::{
1818
};
1919
use crossterm::event::Event;
2020
use ratatui::{
21-
backend::Backend,
2221
layout::{Constraint, Direction, Layout, Rect},
2322
text::{Line, Span, Text},
2423
Frame,
@@ -102,11 +101,7 @@ impl CompareDetailsComponent {
102101
}
103102

104103
impl DrawableComponent for CompareDetailsComponent {
105-
fn draw<B: Backend>(
106-
&self,
107-
f: &mut Frame<B>,
108-
rect: Rect,
109-
) -> Result<()> {
104+
fn draw(&self, f: &mut Frame, rect: Rect) -> Result<()> {
110105
let chunks = Layout::default()
111106
.direction(Direction::Vertical)
112107
.constraints(

src/components/commit_details/details.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use asyncgit::sync::{
1717
};
1818
use crossterm::event::Event;
1919
use ratatui::{
20-
backend::Backend,
2120
layout::{Constraint, Direction, Layout, Rect},
2221
style::{Modifier, Style},
2322
text::{Line, Span, Text},
@@ -255,11 +254,7 @@ impl DetailsComponent {
255254
}
256255

257256
impl DrawableComponent for DetailsComponent {
258-
fn draw<B: Backend>(
259-
&self,
260-
f: &mut Frame<B>,
261-
rect: Rect,
262-
) -> Result<()> {
257+
fn draw(&self, f: &mut Frame, rect: Rect) -> Result<()> {
263258
const CANSCROLL_STRING: &str = "[\u{2026}]";
264259
const EMPTY_STRING: &str = "";
265260

src/components/commit_details/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use compare_details::CompareDetailsComponent;
2121
use crossterm::event::Event;
2222
use details::DetailsComponent;
2323
use ratatui::{
24-
backend::Backend,
2524
layout::{Constraint, Direction, Layout, Rect},
2625
Frame,
2726
};
@@ -140,11 +139,7 @@ impl CommitDetailsComponent {
140139
}
141140

142141
impl DrawableComponent for CommitDetailsComponent {
143-
fn draw<B: Backend>(
144-
&self,
145-
f: &mut Frame<B>,
146-
rect: Rect,
147-
) -> Result<()> {
142+
fn draw(&self, f: &mut Frame, rect: Rect) -> Result<()> {
148143
if !self.visible {
149144
return Ok(());
150145
}

src/components/commitlist.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use crossterm::event::Event;
2222
use indexmap::IndexSet;
2323
use itertools::Itertools;
2424
use ratatui::{
25-
backend::Backend,
2625
layout::{Alignment, Rect},
2726
style::Style,
2827
text::{Line, Span},
@@ -772,11 +771,7 @@ impl CommitList {
772771
}
773772

774773
impl DrawableComponent for CommitList {
775-
fn draw<B: Backend>(
776-
&self,
777-
f: &mut Frame<B>,
778-
area: Rect,
779-
) -> Result<()> {
774+
fn draw(&self, f: &mut Frame, area: Rect) -> Result<()> {
780775
let current_size = (
781776
area.width.saturating_sub(2),
782777
area.height.saturating_sub(2),

src/components/cred.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::Result;
22
use crossterm::event::Event;
3-
use ratatui::{backend::Backend, layout::Rect, Frame};
3+
use ratatui::{layout::Rect, Frame};
44

55
use asyncgit::sync::cred::BasicAuthCredential;
66

@@ -60,11 +60,7 @@ impl CredComponent {
6060
}
6161

6262
impl DrawableComponent for CredComponent {
63-
fn draw<B: Backend>(
64-
&self,
65-
f: &mut Frame<B>,
66-
rect: Rect,
67-
) -> Result<()> {
63+
fn draw(&self, f: &mut Frame, rect: Rect) -> Result<()> {
6864
if self.visible {
6965
self.input_username.draw(f, rect)?;
7066
self.input_password.draw(f, rect)?;

0 commit comments

Comments
 (0)