Skip to content

Commit

Permalink
Seperate style and title variables (#537)
Browse files Browse the repository at this point in the history
Added lj's thought process from #490

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
  • Loading branch information
jeevithakannan2 and lj3954 authored Sep 19, 2024
1 parent 035aff2 commit 176ce1f
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,16 @@ impl AppState {
Style::new()
};

let title = format!(
"Linux Toolbox - {} {}",
env!("BUILD_DATE"),
self.multi_select.then(|| "[Multi-Select]").unwrap_or("")
);

// Create the list widget with items
let list = List::new(items)
.highlight_style(if let Focus::List = self.focus {
Style::default().reversed()
} else {
Style::new()
})
.block(Block::default().borders(Borders::ALL).title(format!(
"Linux Toolbox - {} {}",
env!("BUILD_DATE"),
if self.multi_select {
"[Multi-Select]"
} else {
""
}
)))
.highlight_style(style)
.block(Block::default().borders(Borders::ALL).title(title))
.scroll_padding(1);
frame.render_stateful_widget(list, chunks[1], &mut self.selection);

Expand Down

0 comments on commit 176ce1f

Please # to comment.