pub struct ListItem<'a> { /* private fields */ }Expand description
Individual item in a Material Design list.
List items can contain primary text, secondary text, overline text, leading and trailing icons, and custom actions.
§Example
let item = ListItem::new("Primary Text")
.secondary_text("Secondary supporting text")
.leading_icon("person")
.trailing_icon("more_vert")
.on_click(|| println!("Item clicked"));Implementations§
Source§impl<'a> ListItem<'a>
impl<'a> ListItem<'a>
Sourcepub fn secondary_text(self, text: impl Into<String>) -> Self
pub fn secondary_text(self, text: impl Into<String>) -> Self
Sourcepub fn leading_icon(self, icon: impl Into<String>) -> Self
pub fn leading_icon(self, icon: impl Into<String>) -> Self
Sourcepub fn trailing_icon(self, icon: impl Into<String>) -> Self
pub fn trailing_icon(self, icon: impl Into<String>) -> Self
Sourcepub fn trailing_text(self, text: impl Into<String>) -> Self
pub fn trailing_text(self, text: impl Into<String>) -> Self
Sourcepub fn is_three_line(self, is_three_line: bool) -> Self
pub fn is_three_line(self, is_three_line: bool) -> Self
Sourcepub fn visual_density(self, density: VisualDensity) -> Self
pub fn visual_density(self, density: VisualDensity) -> Self
Sourcepub fn style(self, style: ListTileStyle) -> Self
pub fn style(self, style: ListTileStyle) -> Self
Sourcepub fn title_alignment(self, alignment: ListTileTitleAlignment) -> Self
pub fn title_alignment(self, alignment: ListTileTitleAlignment) -> Self
Sourcepub fn horizontal_title_gap(self, gap: f32) -> Self
pub fn horizontal_title_gap(self, gap: f32) -> Self
Sourcepub fn min_vertical_padding(self, padding: f32) -> Self
pub fn min_vertical_padding(self, padding: f32) -> Self
Sourcepub fn min_leading_width(self, width: f32) -> Self
pub fn min_leading_width(self, width: f32) -> Self
Sourcepub fn min_tile_height(self, height: f32) -> Self
pub fn min_tile_height(self, height: f32) -> Self
Sourcepub fn tile_color(self, color: Color32) -> Self
pub fn tile_color(self, color: Color32) -> Self
Sourcepub fn selected_tile_color(self, color: Color32) -> Self
pub fn selected_tile_color(self, color: Color32) -> Self
Sourcepub fn selected_color(self, color: Color32) -> Self
pub fn selected_color(self, color: Color32) -> Self
Sourcepub fn icon_color(self, color: Color32) -> Self
pub fn icon_color(self, color: Color32) -> Self
Sourcepub fn text_color(self, color: Color32) -> Self
pub fn text_color(self, color: Color32) -> Self
Auto Trait Implementations§
impl<'a> Freeze for ListItem<'a>
impl<'a> !RefUnwindSafe for ListItem<'a>
impl<'a> !Send for ListItem<'a>
impl<'a> !Sync for ListItem<'a>
impl<'a> Unpin for ListItem<'a>
impl<'a> UnsafeUnpin for ListItem<'a>
impl<'a> !UnwindSafe for ListItem<'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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.