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:
parent
fcbc18a380
commit
f02a3e8c68
9 changed files with 108 additions and 59 deletions
|
@ -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))
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue