pub struct MaterialImageList<'a> { /* private fields */ }Expand description
Material Design image list component.
Image lists display a collection of images in an organized grid. They’re commonly used to display a collection of photos or other images.
let image_list = MaterialImageList::standard()
.columns(3)
.item("Image 1", "320x240.png")
.item("Image 2", "320x240.png")
.item("Image 3", "320x240.png");
ui.add(image_list);Implementations§
Source§impl<'a> MaterialImageList<'a>
impl<'a> MaterialImageList<'a>
Sourcepub fn item(
self,
label: impl Into<String>,
image_source: impl Into<String>,
) -> Self
pub fn item( self, label: impl Into<String>, image_source: impl Into<String>, ) -> Self
Add an image item.
Sourcepub fn item_with_callback<F>(
self,
label: impl Into<String>,
image_source: impl Into<String>,
callback: F,
) -> Self
pub fn item_with_callback<F>( self, label: impl Into<String>, image_source: impl Into<String>, callback: F, ) -> Self
Add an image item with callback.
Sourcepub fn item_spacing(self, spacing: f32) -> Self
pub fn item_spacing(self, spacing: f32) -> Self
Set item spacing.
Sourcepub fn text_protected(self, protected: bool) -> Self
pub fn text_protected(self, protected: bool) -> Self
Enable text protection overlay.
Sourcepub fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
pub fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
Set corner radius.
Sourcepub fn id_salt(self, salt: impl Into<String>) -> Self
pub fn id_salt(self, salt: impl Into<String>) -> Self
Set unique ID salt to prevent ID clashes.
Sourcepub fn items_from_paths<I, P>(self, paths: I) -> Self
pub fn items_from_paths<I, P>(self, paths: I) -> Self
Add items from a collection of file paths.
Sourcepub fn items_from_urls<I, S>(self, urls: I) -> Self
pub fn items_from_urls<I, S>(self, urls: I) -> Self
Add items from a collection of URLs.
Sourcepub fn items_from_bytes<I>(self, bytes_collection: I) -> Self
pub fn items_from_bytes<I>(self, bytes_collection: I) -> Self
Add items from a collection of byte arrays (for embedded images).
Trait Implementations§
Source§impl<'a> Default for MaterialImageList<'a>
impl<'a> Default for MaterialImageList<'a>
Auto Trait Implementations§
impl<'a> Freeze for MaterialImageList<'a>
impl<'a> !RefUnwindSafe for MaterialImageList<'a>
impl<'a> Send for MaterialImageList<'a>
impl<'a> Sync for MaterialImageList<'a>
impl<'a> Unpin for MaterialImageList<'a>
impl<'a> !UnwindSafe for MaterialImageList<'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.