Skip to content

Commit

Permalink
chore: fix code for ratatui 0.25.0 breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiapple852 committed Dec 20, 2023
1 parent 73367f9 commit 947c4ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/frontend/render/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn render_settings_table(
.unwrap_or_default()
.max(30);
let table_widths = [Constraint::Min(item_width), Constraint::Length(60)];
let table = Table::new(rows)
let table = Table::new(rows, table_widths)
.header(header)
.block(
Block::default()
Expand All @@ -94,8 +94,7 @@ fn render_settings_table(
.bg(app.tui_config.theme.bg_color)
.fg(app.tui_config.theme.text_color),
)
.highlight_style(Style::default().add_modifier(Modifier::REVERSED))
.widths(&table_widths);
.highlight_style(Style::default().add_modifier(Modifier::REVERSED));
f.render_stateful_widget(table, rect, &mut app.setting_table_state);
}

Expand Down
3 changes: 1 addition & 2 deletions src/frontend/render/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn render(f: &mut Frame<'_>, app: &mut TuiApp, rect: Rect) {
&config.tui_columns,
)
});
let table = Table::new(rows)
let table = Table::new(rows, widths.as_slice())
.header(header)
.block(
Block::default()
Expand All @@ -60,7 +60,6 @@ pub fn render(f: &mut Frame<'_>, app: &mut TuiApp, rect: Rect) {
.fg(app.tui_config.theme.text_color),
)
.highlight_style(selected_style)
.widths(widths.as_slice())
.column_spacing(1);
f.render_stateful_widget(table, rect, &mut app.table_state);
}
Expand Down

0 comments on commit 947c4ce

Please sign in to comment.