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

@ -580,7 +580,7 @@ impl Item for Editor {
Some(path.to_string_lossy().to_string().into())
}
fn tab_content(&self, detail: Option<usize>, cx: &WindowContext) -> AnyElement {
fn tab_content(&self, detail: Option<usize>, selected: bool, cx: &WindowContext) -> AnyElement {
let theme = cx.theme();
let description = detail.and_then(|detail| {
@ -597,7 +597,11 @@ impl Item for Editor {
h_stack()
.gap_2()
.child(Label::new(self.title(cx).to_string()))
.child(Label::new(self.title(cx).to_string()).color(if selected {
Color::Default
} else {
Color::Muted
}))
.when_some(description, |this, description| {
this.child(Label::new(description).color(Color::Muted))
})