Skip to content

Commit 3796c7a

Browse files
Add colors for nm cmds
1 parent 8edd12f commit 3796c7a

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

tui/src/state.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,12 @@ impl AppState {
315315
let (indicator, style) = if is_selected {
316316
(self.theme.multi_select_icon(), Style::default().bold())
317317
} else {
318-
("", Style::new())
318+
let ms_style = if self.multi_select && !node.multi_select {
319+
Style::default().fg(self.theme.multi_select_disabled_color())
320+
} else {
321+
Style::new()
322+
};
323+
("", ms_style)
319324
};
320325
if *has_children {
321326
Line::from(format!(
@@ -325,6 +330,7 @@ impl AppState {
325330
indicator
326331
))
327332
.style(self.theme.dir_color())
333+
.patch_style(style)
328334
} else {
329335
Line::from(format!(
330336
"{} {} {}",
@@ -342,13 +348,21 @@ impl AppState {
342348
|ListEntry {
343349
node, has_children, ..
344350
}| {
351+
let ms_style = if self.multi_select && !node.multi_select {
352+
Style::default().fg(self.theme.multi_select_disabled_color())
353+
} else {
354+
Style::new()
355+
};
345356
if *has_children {
346-
Line::from(" ").style(self.theme.dir_color())
357+
Line::from(" ")
358+
.style(self.theme.dir_color())
359+
.patch_style(ms_style)
347360
} else {
348361
Line::from(format!("{} ", node.task_list))
349362
.alignment(Alignment::Right)
350363
.style(self.theme.cmd_color())
351364
.bold()
365+
.patch_style(ms_style)
352366
}
353367
},
354368
));

tui/src/theme.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ impl Theme {
2828
}
2929
}
3030

31+
pub fn multi_select_disabled_color(&self) -> Color {
32+
match self {
33+
Theme::Default => Color::DarkGray,
34+
Theme::Compatible => Color::DarkGray,
35+
}
36+
}
37+
3138
pub fn tab_color(&self) -> Color {
3239
match self {
3340
Theme::Default => Color::Rgb(255, 255, 85),

0 commit comments

Comments
 (0)