Fix inactive tab styles (the verbose way) (#3591)

This PR fixes the inactive tab style to properly show the label using
the muted text color.

I went about fixing this in the most direct way possible, but the
solution leaves a lot to be desired, IMO. I plan to explore some ideas
on how we can improve the state of styling the tab content without
having the same styles repeated all over the place and subsequently
out-of-sync.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-12-11 15:42:17 -05:00 committed by GitHub
parent fcbc18a380
commit f02a3e8c68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 108 additions and 59 deletions

View file

@ -686,13 +686,22 @@ impl Item for TerminalView {
Some(self.terminal().read(cx).title().into())
}
fn tab_content(&self, _detail: Option<usize>, cx: &WindowContext) -> AnyElement {
fn tab_content(
&self,
_detail: Option<usize>,
selected: bool,
cx: &WindowContext,
) -> AnyElement {
let title = self.terminal().read(cx).title();
h_stack()
.gap_2()
.child(IconElement::new(Icon::Terminal))
.child(Label::new(title))
.child(Label::new(title).color(if selected {
Color::Default
} else {
Color::Muted
}))
.into_any()
}