Skip to content

Commit

Permalink
Add colors for nm cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Oct 1, 2024
1 parent 8edd12f commit 3796c7a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,12 @@ impl AppState {
let (indicator, style) = if is_selected {
(self.theme.multi_select_icon(), Style::default().bold())
} 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 {
Line::from(format!(
Expand All @@ -325,6 +330,7 @@ impl AppState {
indicator
))
.style(self.theme.dir_color())
.patch_style(style)
} else {
Line::from(format!(
"{} {} {}",
Expand All @@ -342,13 +348,21 @@ impl AppState {
|ListEntry {
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 {
Line::from(" ").style(self.theme.dir_color())
Line::from(" ")
.style(self.theme.dir_color())
.patch_style(ms_style)
} else {
Line::from(format!("{} ", node.task_list))
.alignment(Alignment::Right)
.style(self.theme.cmd_color())
.bold()
.patch_style(ms_style)
}
},
));
Expand Down
7 changes: 7 additions & 0 deletions tui/src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
match self {
Theme::Default => Color::Rgb(255, 255, 85),
Expand Down

0 comments on commit 3796c7a

Please sign in to comment.