Skip to content

Commit

Permalink
fix: table_widget header setup
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanaden committed Jun 23, 2024
1 parent dfb5bf6 commit 257c3bd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions rm-main/src/ui/tabs/torrents/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,17 @@ impl TorrentsTab {
.general
.accent_color);

let mut table_widget = Table::new(torrent_rows, table_manager_lock.widths)
.highlight_style(highlight_table_style);

if !self.ctx.config.general.hide_headers {
table_widget = table_widget
.header(Row::new(
let table_widget = {
let table = Table::new(torrent_rows, table_manager_lock.widths)
.highlight_style(highlight_table_style);
if !self.ctx.config.general.hide_headers {
table.header(Row::new(
table_manager_lock.header().iter().map(|s| s.as_str()),
))
.clone();
}
} else {
table
}
};

f.render_stateful_widget(
table_widget,
Expand Down

0 comments on commit 257c3bd

Please sign in to comment.