pub struct Icon {
pub size: f32,
pub color: Color,
/* private fields */
}Expand description
A Material Symbols icon glyph rendered through the text pipeline at any
size. Circle/Dot stay primitive-drawn filled discs (see
IconKind::codepoint).
Fields§
§size: f32§color: ColorImplementations§
Source§impl Icon
impl Icon
Sourcepub fn glyph(codepoint: char) -> Self
pub fn glyph(codepoint: char) -> Self
Any codepoint from the icon font — for glyphs without a built-in
IconKind or registered name.
Sourcepub fn named(name: impl Into<String>) -> Self
pub fn named(name: impl Into<String>) -> Self
An icon by registered name (register_icon); all Material
Symbols names are pre-registered. Resolved at paint time, so
registration order doesn’t matter; unresolved names paint a hollow
placeholder box.
pub fn size(self, s: f32) -> Self
pub fn color(self, c: Color) -> Self
Trait Implementations§
Source§impl Widget for Icon
impl Widget for Icon
Source§fn layout(&self, _ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, _ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl Freeze for Icon
impl RefUnwindSafe for Icon
impl Send for Icon
impl Sync for Icon
impl Unpin for Icon
impl UnsafeUnpin for Icon
impl UnwindSafe for Icon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.