ui: Update Label component (#24653)

- Standardize style methods
- Convert label story to a component preview
- update component preview styles  

Release Notes:

- N/A
This commit is contained in:
Nate Butler 2025-02-11 15:16:59 -05:00 committed by GitHub
parent aab3e0495d
commit 2d71733490
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 182 additions and 151 deletions

View file

@ -36,7 +36,7 @@ use std::{
};
use text::{BufferId, Selection};
use theme::{Theme, ThemeSettings};
use ui::{h_flex, prelude::*, IconDecorationKind, Label};
use ui::{prelude::*, IconDecorationKind};
use util::{paths::PathExt, ResultExt, TryFutureExt};
use workspace::item::{Dedup, ItemSettings, SerializableItem, TabContentParams};
use workspace::{
@ -679,8 +679,8 @@ impl Item for Editor {
.child(
Label::new(self.title(cx).to_string())
.color(label_color)
.italic(params.preview)
.strikethrough(was_deleted),
.when(params.preview, |this| this.italic())
.when(was_deleted, |this| this.strikethrough()),
)
.when_some(description, |this, description| {
this.child(