
This PR creates a new, revamped `DecoratedIcon` component that enables using different SVGs, one for the knockout background and another for the actual icon. That's different than what we were doing before—copying the SVG and using slightly different positioning—because we wanted to unlock an aligned knockout effect, which was particularly hard to do with non-simple shapes such as an X. Release Notes: - N/A --------- Co-authored-by: Nate Butler <1714999+iamnbutler@users.noreply.github.com>
20 lines
535 B
Rust
20 lines
535 B
Rust
use gpui::Render;
|
|
use story::Story;
|
|
use strum::IntoEnumIterator;
|
|
|
|
use crate::prelude::*;
|
|
use crate::{Icon, IconName};
|
|
|
|
pub struct IconStory;
|
|
|
|
impl Render for IconStory {
|
|
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {
|
|
let icons = IconName::iter();
|
|
|
|
Story::container()
|
|
.child(Story::title_for::<Icon>())
|
|
.child(Story::label("DecoratedIcon"))
|
|
.child(Story::label("All Icons"))
|
|
.child(div().flex().gap_3().children(icons.map(Icon::new)))
|
|
}
|
|
}
|