Use extra small label for tab descriptions (#3797)

This PR adjusts the size of the tab descriptions to use the extra small
label size.

This makes it easier to distinguish between the filename and the
description:

<img width="320" alt="Screenshot 2023-12-22 at 6 49 11 PM"
src="https://github.com/zed-industries/zed/assets/1486634/451d4cd0-666c-43c2-b5df-6d9cf91dacda">

It's also more in line with how things look in Zed1.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-12-22 18:56:17 -05:00 committed by GitHub
parent ca7e504817
commit 3213a860a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 20 deletions

View file

@ -8,14 +8,15 @@ pub enum LabelSize {
#[default]
Default,
Small,
XSmall,
}
#[derive(Default, PartialEq, Copy, Clone)]
pub enum LineHeightStyle {
#[default]
TextLabel,
/// Sets the line height to 1
UILabel,
/// Sets the line height to 1.
UiLabel,
}
pub trait LabelCommon {
@ -92,8 +93,9 @@ impl RenderOnce for LabelLike {
.map(|this| match self.size {
LabelSize::Default => this.text_ui(),
LabelSize::Small => this.text_ui_sm(),
LabelSize::XSmall => this.text_ui_xs(),
})
.when(self.line_height_style == LineHeightStyle::UILabel, |this| {
.when(self.line_height_style == LineHeightStyle::UiLabel, |this| {
this.line_height(relative(1.))
})
.text_color(self.color.color(cx))