Merge pull request #2230 from zed-industries/fix-tab-x

Fix tab bar x
This commit is contained in:
Mikayla Maki 2023-03-02 19:48:08 -08:00 committed by GitHub
commit 24ba47e75d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 6 deletions

View file

@ -253,7 +253,7 @@ impl Item for ProjectSearchView {
Svg::new("icons/magnifying_glass_12.svg") Svg::new("icons/magnifying_glass_12.svg")
.with_color(tab_theme.label.text.color) .with_color(tab_theme.label.text.color)
.constrained() .constrained()
.with_width(tab_theme.icon_width) .with_width(tab_theme.type_icon_width)
.aligned() .aligned()
.contained() .contained()
.with_margin_right(tab_theme.spacing) .with_margin_right(tab_theme.spacing)

View file

@ -585,7 +585,7 @@ impl Item for TerminalView {
gpui::elements::Svg::new("icons/terminal_12.svg") gpui::elements::Svg::new("icons/terminal_12.svg")
.with_color(tab_theme.label.text.color) .with_color(tab_theme.label.text.color)
.constrained() .constrained()
.with_width(tab_theme.icon_width) .with_width(tab_theme.type_icon_width)
.aligned() .aligned()
.contained() .contained()
.with_margin_right(tab_theme.spacing) .with_margin_right(tab_theme.spacing)

View file

@ -215,7 +215,8 @@ pub struct Tab {
pub label: LabelStyle, pub label: LabelStyle,
pub description: ContainedText, pub description: ContainedText,
pub spacing: f32, pub spacing: f32,
pub icon_width: f32, pub close_icon_width: f32,
pub type_icon_width: f32,
pub icon_close: Color, pub icon_close: Color,
pub icon_close_active: Color, pub icon_close_active: Color,
pub icon_dirty: Color, pub icon_dirty: Color,

View file

@ -1355,7 +1355,7 @@ impl Pane {
} else { } else {
Empty::new().boxed() Empty::new().boxed()
}) })
.with_width(tab_style.icon_width) .with_width(tab_style.close_icon_width)
.boxed(), .boxed(),
) )
.boxed(), .boxed(),

View file

@ -108,7 +108,7 @@ impl Item for SharedScreen {
Svg::new("icons/disable_screen_sharing_12.svg") Svg::new("icons/disable_screen_sharing_12.svg")
.with_color(style.label.text.color) .with_color(style.label.text.color)
.constrained() .constrained()
.with_width(style.icon_width) .with_width(style.type_icon_width)
.aligned() .aligned()
.contained() .contained()
.with_margin_right(style.spacing) .with_margin_right(style.spacing)

View file

@ -23,8 +23,11 @@ export default function tabBar(colorScheme: ColorScheme) {
}, },
spacing: 8, spacing: 8,
// Tab type icons (e.g. Project Search)
typeIconWidth: 14,
// Close icons // Close icons
iconWidth: 14, closeIconWidth: 8,
iconClose: foreground(layer, "variant"), iconClose: foreground(layer, "variant"),
iconCloseActive: foreground(layer, "hovered"), iconCloseActive: foreground(layer, "hovered"),