Skip to content

Commit 176ce1f

Browse files
Seperate style and title variables (#537)
Added lj's thought process from #490 Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
1 parent 035aff2 commit 176ce1f

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

tui/src/state.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -237,22 +237,16 @@ impl AppState {
237237
Style::new()
238238
};
239239

240+
let title = format!(
241+
"Linux Toolbox - {} {}",
242+
env!("BUILD_DATE"),
243+
self.multi_select.then(|| "[Multi-Select]").unwrap_or("")
244+
);
245+
240246
// Create the list widget with items
241247
let list = List::new(items)
242-
.highlight_style(if let Focus::List = self.focus {
243-
Style::default().reversed()
244-
} else {
245-
Style::new()
246-
})
247-
.block(Block::default().borders(Borders::ALL).title(format!(
248-
"Linux Toolbox - {} {}",
249-
env!("BUILD_DATE"),
250-
if self.multi_select {
251-
"[Multi-Select]"
252-
} else {
253-
""
254-
}
255-
)))
248+
.highlight_style(style)
249+
.block(Block::default().borders(Borders::ALL).title(title))
256250
.scroll_padding(1);
257251
frame.render_stateful_widget(list, chunks[1], &mut self.selection);
258252

0 commit comments

Comments
 (0)