mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-07 19:19:12 +00:00
31 lines
887 B
Rust
31 lines
887 B
Rust
#[cfg(feature = "stories")]
|
|
pub use stories::*;
|
|
|
|
#[cfg(feature = "stories")]
|
|
mod stories {
|
|
use super::*;
|
|
use crate::Story;
|
|
use gpui::{Div, Render};
|
|
|
|
pub struct LabelStory;
|
|
|
|
impl Render for LabelStory {
|
|
type Element = Div;
|
|
|
|
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
|
|
Story::container(cx)
|
|
.child(Story::title_for::<Label>(cx))
|
|
.child(Story::label(cx, "Default"))
|
|
.child(Label::new("Hello, world!"))
|
|
.child(Story::label(cx, "Highlighted"))
|
|
.child(HighlightedLabel::new(
|
|
"Hello, world!",
|
|
vec![0, 1, 2, 7, 8, 12],
|
|
))
|
|
.child(HighlightedLabel::new(
|
|
"Héllo, world!",
|
|
vec![0, 1, 3, 8, 9, 13],
|
|
))
|
|
}
|
|
}
|
|
}
|