pub struct MaterialIconButton<'a> { /* private fields */ }Expand description
Material Design icon button component.
Icon buttons help users take supplementary actions with a single tap. They’re used when a compact button is required.
§Example
// Standard icon button
if ui.add(MaterialIconButton::standard("favorite")).clicked() {
println!("Favorite clicked!");
}
// Filled icon button with toggle state
let mut liked = false;
ui.add(MaterialIconButton::filled("favorite")
.toggle(&mut liked)
.size(48.0));Implementations§
Source§impl<'a> MaterialIconButton<'a>
impl<'a> MaterialIconButton<'a>
Sourcepub fn new(icon: impl Into<String>, variant: IconButtonVariant) -> Self
pub fn new(icon: impl Into<String>, variant: IconButtonVariant) -> Self
Sourcepub fn filled_tonal(icon: impl Into<String>) -> Self
pub fn filled_tonal(icon: impl Into<String>) -> Self
Sourcepub fn svg(self, path: impl Into<String>) -> Self
pub fn svg(self, path: impl Into<String>) -> Self
Use an SVG file as the icon. The path will be loaded and rasterized.
Sourcepub fn svg_data(self, svg_content: impl Into<String>) -> Self
pub fn svg_data(self, svg_content: impl Into<String>) -> Self
Use inline SVG content as the icon. The content will be rasterized directly.
Sourcepub fn icon_color(self, color: Color32) -> Self
pub fn icon_color(self, color: Color32) -> Self
Override the icon color.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for MaterialIconButton<'a>
impl<'a> !RefUnwindSafe for MaterialIconButton<'a>
impl<'a> !Send for MaterialIconButton<'a>
impl<'a> !Sync for MaterialIconButton<'a>
impl<'a> Unpin for MaterialIconButton<'a>
impl<'a> UnsafeUnpin for MaterialIconButton<'a>
impl<'a> !UnwindSafe for MaterialIconButton<'a>
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