Fix tab text colors

This commit is contained in:
Conrad Irwin 2023-11-03 09:12:12 -06:00
parent b21c25826d
commit 0edcec7c4e
2 changed files with 12 additions and 3 deletions

View File

@ -584,12 +584,18 @@ impl Item for Editor {
.flex()
.flex_row()
.items_center()
.text_color(gpui::white())
.gap_2()
.child(self.title(cx).to_string())
.children(detail.and_then(|detail| {
let path = path_for_buffer(&self.buffer, detail, false, cx)?;
let description = path.to_string_lossy();
Some(util::truncate_and_trailoff(&description, MAX_TAB_TITLE_LEN))
Some(
div()
.text_color(theme.colors().text_muted)
.text_xs()
.child(util::truncate_and_trailoff(&description, MAX_TAB_TITLE_LEN)),
)
})),
)
}

View File

@ -1361,13 +1361,15 @@ impl Pane {
let label = item.tab_content(Some(detail), cx);
let close_icon = || IconElement::new(Icon::Close).color(IconColor::Muted);
let (tab_bg, tab_hover_bg, tab_active_bg) = match ix == self.active_item_index {
let (text_color, tab_bg, tab_hover_bg, tab_active_bg) = match ix == self.active_item_index {
false => (
cx.theme().colors().text_muted,
cx.theme().colors().tab_inactive,
cx.theme().colors().ghost_element_hover,
cx.theme().colors().ghost_element_active,
),
true => (
cx.theme().colors().text,
cx.theme().colors().tab_active,
cx.theme().colors().element_hover,
cx.theme().colors().element_active,
@ -1397,6 +1399,7 @@ impl Pane {
.flex()
.items_center()
.gap_1p5()
.text_color(text_color)
.children(if item.has_conflict(cx) {
Some(
IconElement::new(Icon::ExclamationTriangle)