diff --git a/crates/ui/src/dropdown.rs b/crates/ui/src/dropdown.rs index c9b7b661..9b183aec 100644 --- a/crates/ui/src/dropdown.rs +++ b/crates/ui/src/dropdown.rs @@ -247,7 +247,7 @@ pub struct Dropdown { focus_handle: FocusHandle, list: Entity>>, size: Size, - icon: Option, + icon: Option, open: bool, cleanable: bool, placeholder: Option, @@ -408,7 +408,7 @@ where } /// Set the right icon for the dropdown input, instead of the default arrow icon. - pub fn icon(mut self, icon: impl Into) -> Self { + pub fn icon(mut self, icon: impl Into) -> Self { self.icon = Some(icon.into()); self } @@ -719,14 +719,14 @@ where Some(icon) => icon, None => { if self.open { - IconName::ChevronUp + Icon::new(IconName::ChevronUp) } else { - IconName::ChevronDown + Icon::new(IconName::ChevronDown) } } }; - this.child(Icon::new(icon).xsmall().text_color( + this.child(icon.xsmall().text_color( match self.disabled { true => cx.theme().muted_foreground.opacity(0.5), false => cx.theme().muted_foreground, diff --git a/crates/ui/src/list/list_item.rs b/crates/ui/src/list/list_item.rs index 1531fce1..4afa18b6 100644 --- a/crates/ui/src/list/list_item.rs +++ b/crates/ui/src/list/list_item.rs @@ -1,4 +1,4 @@ -use crate::{h_flex, ActiveTheme, Disableable, Icon, IconName, Selectable, Sizable as _}; +use crate::{h_flex, ActiveTheme, Disableable, Icon, Selectable, Sizable as _}; use gpui::{ div, prelude::FluentBuilder as _, AnyElement, App, ClickEvent, Div, ElementId, InteractiveElement, IntoElement, MouseButton, MouseMoveEvent, ParentElement, RenderOnce, @@ -38,8 +38,8 @@ impl ListItem { } /// Set to show check icon, default is None. - pub fn check_icon(mut self, icon: IconName) -> Self { - self.check_icon = Some(Icon::new(icon)); + pub fn check_icon(mut self, icon: impl Into) -> Self { + self.check_icon = Some(icon.into()); self }