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:
@@ -12,7 +12,7 @@ use gpui::{
|
||||
VisualContext, WindowContext,
|
||||
};
|
||||
use std::sync::{Arc, Weak};
|
||||
use ui::{h_stack, Icon, IconElement};
|
||||
use ui::{h_stack, prelude::*, Icon, IconElement, Label};
|
||||
|
||||
pub enum Event {
|
||||
Close,
|
||||
@@ -90,14 +90,22 @@ impl Item for SharedScreen {
|
||||
}
|
||||
}
|
||||
|
||||
fn tab_content(&self, _: Option<usize>, _: &WindowContext<'_>) -> gpui::AnyElement {
|
||||
fn tab_content(
|
||||
&self,
|
||||
_: Option<usize>,
|
||||
selected: bool,
|
||||
_: &WindowContext<'_>,
|
||||
) -> gpui::AnyElement {
|
||||
h_stack()
|
||||
.gap_1()
|
||||
.child(IconElement::new(Icon::Screen))
|
||||
.child(SharedString::from(format!(
|
||||
"{}'s screen",
|
||||
self.user.github_login
|
||||
)))
|
||||
.child(
|
||||
Label::new(format!("{}'s screen", self.user.github_login)).color(if selected {
|
||||
Color::Default
|
||||
} else {
|
||||
Color::Muted
|
||||
}),
|
||||
)
|
||||
.into_any()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user