Rename IconElement to just Icon (#3974)

This PR renames the `IconElement` component to just `Icon`.

This better matches the rest of our components, as `IconElement` was the
only one using this naming convention.

The `Icon` enum has been renamed to `IconName` to free up the name.

I was trying to come up with a way that would allow rendering an
`Icon::Zed` directly (and thus make the `IconElement` a hidden part of
the API), but I couldn't come up with a way to do this cleanly.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-01-09 10:11:20 -05:00 committed by GitHub
parent 29ed067b26
commit fa53353c57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 364 additions and 360 deletions

View file

@ -1,7 +1,7 @@
use gpui::Render;
use story::Story;
use crate::{prelude::*, Icon};
use crate::{prelude::*, IconName};
use crate::{Button, ButtonStyle};
pub struct ButtonStory;
@ -23,12 +23,12 @@ impl Render for ButtonStory {
.child(Story::label("With `label_color`"))
.child(Button::new("filled_with_label_color", "Click me").color(Color::Created))
.child(Story::label("With `icon`"))
.child(Button::new("filled_with_icon", "Click me").icon(Icon::FileGit))
.child(Button::new("filled_with_icon", "Click me").icon(IconName::FileGit))
.child(Story::label("Selected with `icon`"))
.child(
Button::new("filled_and_selected_with_icon", "Click me")
.selected(true)
.icon(Icon::FileGit),
.icon(IconName::FileGit),
)
.child(Story::label("Default (Subtle)"))
.child(Button::new("default_subtle", "Click me").style(ButtonStyle::Subtle))