mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2025-01-30 22:34:27 +00:00
ui: "unselect" the current tab when in search mode
This commit is contained in:
parent
d91a44efab
commit
2c0a6ba80e
|
@ -331,16 +331,24 @@ impl AppState {
|
|||
.map(|tab| tab.name.as_str())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let tab_hl_style = if let Focus::TabList = self.focus {
|
||||
Style::default().reversed().fg(self.theme.tab_color())
|
||||
let (tab_hl_style, highlight_symbol) = if let Focus::TabList = self.focus {
|
||||
(
|
||||
Style::default().reversed().fg(self.theme.tab_color()),
|
||||
self.theme.tab_icon(),
|
||||
)
|
||||
} else if let Focus::Search = self.focus {
|
||||
(Style::reset(), " ")
|
||||
} else {
|
||||
Style::new().fg(self.theme.tab_color())
|
||||
(
|
||||
Style::new().fg(self.theme.tab_color()),
|
||||
self.theme.tab_icon(),
|
||||
)
|
||||
};
|
||||
|
||||
let tab_list = List::new(tabs)
|
||||
.block(Block::bordered().border_set(border::ROUNDED))
|
||||
.highlight_style(tab_hl_style)
|
||||
.highlight_symbol(self.theme.tab_icon());
|
||||
.highlight_symbol(highlight_symbol);
|
||||
frame.render_stateful_widget(tab_list, left_chunks[1], &mut self.current_tab);
|
||||
|
||||
let chunks =
|
||||
|
|
Loading…
Reference in New Issue
Block a user