mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-25 06:24:26 +00:00
Add colors for nm cmds
This commit is contained in:
parent
8edd12f0b4
commit
3796c7abdb
|
@ -315,7 +315,12 @@ impl AppState {
|
||||||
let (indicator, style) = if is_selected {
|
let (indicator, style) = if is_selected {
|
||||||
(self.theme.multi_select_icon(), Style::default().bold())
|
(self.theme.multi_select_icon(), Style::default().bold())
|
||||||
} else {
|
} else {
|
||||||
("", Style::new())
|
let ms_style = if self.multi_select && !node.multi_select {
|
||||||
|
Style::default().fg(self.theme.multi_select_disabled_color())
|
||||||
|
} else {
|
||||||
|
Style::new()
|
||||||
|
};
|
||||||
|
("", ms_style)
|
||||||
};
|
};
|
||||||
if *has_children {
|
if *has_children {
|
||||||
Line::from(format!(
|
Line::from(format!(
|
||||||
|
@ -325,6 +330,7 @@ impl AppState {
|
||||||
indicator
|
indicator
|
||||||
))
|
))
|
||||||
.style(self.theme.dir_color())
|
.style(self.theme.dir_color())
|
||||||
|
.patch_style(style)
|
||||||
} else {
|
} else {
|
||||||
Line::from(format!(
|
Line::from(format!(
|
||||||
"{} {} {}",
|
"{} {} {}",
|
||||||
|
@ -342,13 +348,21 @@ impl AppState {
|
||||||
|ListEntry {
|
|ListEntry {
|
||||||
node, has_children, ..
|
node, has_children, ..
|
||||||
}| {
|
}| {
|
||||||
|
let ms_style = if self.multi_select && !node.multi_select {
|
||||||
|
Style::default().fg(self.theme.multi_select_disabled_color())
|
||||||
|
} else {
|
||||||
|
Style::new()
|
||||||
|
};
|
||||||
if *has_children {
|
if *has_children {
|
||||||
Line::from(" ").style(self.theme.dir_color())
|
Line::from(" ")
|
||||||
|
.style(self.theme.dir_color())
|
||||||
|
.patch_style(ms_style)
|
||||||
} else {
|
} else {
|
||||||
Line::from(format!("{} ", node.task_list))
|
Line::from(format!("{} ", node.task_list))
|
||||||
.alignment(Alignment::Right)
|
.alignment(Alignment::Right)
|
||||||
.style(self.theme.cmd_color())
|
.style(self.theme.cmd_color())
|
||||||
.bold()
|
.bold()
|
||||||
|
.patch_style(ms_style)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
|
|
|
@ -28,6 +28,13 @@ impl Theme {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn multi_select_disabled_color(&self) -> Color {
|
||||||
|
match self {
|
||||||
|
Theme::Default => Color::DarkGray,
|
||||||
|
Theme::Compatible => Color::DarkGray,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn tab_color(&self) -> Color {
|
pub fn tab_color(&self) -> Color {
|
||||||
match self {
|
match self {
|
||||||
Theme::Default => Color::Rgb(255, 255, 85),
|
Theme::Default => Color::Rgb(255, 255, 85),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user