pub struct FileIcon(/* private fields */);Expand description
A file’s or folder’s own icon, as the platform’s file manager shows
it: an app’s own, a folder’s custom one, a document’s by its type (the
icon theme’s on Linux). It’s a square as big as the platform’s small
icons (16 points) unless icon_size says otherwise. With thumbnail,
a preview of what’s in the file (a picture’s, a document’s first page)
where the platform makes one. The file is read when it’s set, unless
lookup says to go by its name alone. Its label is its accessible
name; without one it’s decorative, as it usually sits beside the
file’s name.
FileIcon::new(&entry.path).icon_size(32.0).thumbnail(true)
FileIcon::new(&member.name).lookup(FileLookup::FileName)Implementations§
Source§impl FileIcon
impl FileIcon
pub fn new(path: impl IntoValue<PathBuf>) -> FileIcon
Sourcepub fn label(self, label: impl IntoValue<String>) -> FileIcon
pub fn label(self, label: impl IntoValue<String>) -> FileIcon
Its accessible name, where no text beside it names the file.
Sourcepub fn thumbnail(self, thumbnail: impl IntoValue<bool>) -> FileIcon
pub fn thumbnail(self, thumbnail: impl IntoValue<bool>) -> FileIcon
Shows a preview of what’s in the file where the platform makes one (macOS, Windows, and GNOME’s cached ones), its icon until then.
Sourcepub fn lookup(self, lookup: impl IntoValue<FileLookup>) -> FileIcon
pub fn lookup(self, lookup: impl IntoValue<FileLookup>) -> FileIcon
Where its icon comes from: the file on disk (the default), or only
its name, for a file that isn’t there (nothing is read, and
thumbnail is ignored).
Trait Implementations§
Source§impl ElementBuilder for FileIcon
impl ElementBuilder for FileIcon
fn element(&mut self) -> &mut Element
Source§fn style(self, f: impl FnOnce(&mut Style)) -> Self
fn style(self, f: impl FnOnce(&mut Style)) -> Self
Source§fn style_with(self, f: impl Fn(&mut Style) + 'static) -> Self
fn style_with(self, f: impl Fn(&mut Style) + 'static) -> Self
f re-runs whenever the
signals it reads change, and must set every field it cares about.fn width(self, value: impl IntoValue<Length>) -> Self
fn height(self, value: impl IntoValue<Length>) -> Self
fn min_width(self, value: impl IntoValue<Length>) -> Self
fn min_height(self, value: impl IntoValue<Length>) -> Self
fn max_width(self, value: impl IntoValue<Length>) -> Self
fn max_height(self, value: impl IntoValue<Length>) -> Self
fn aspect_ratio(self, value: impl IntoValue<f32>) -> Self
fn padding(self, value: impl IntoValue<Length>) -> Self
fn padding_x(self, value: impl IntoValue<Length>) -> Self
fn padding_y(self, value: impl IntoValue<Length>) -> Self
fn padding_start(self, value: impl IntoValue<Length>) -> Self
fn padding_end(self, value: impl IntoValue<Length>) -> Self
fn padding_top(self, value: impl IntoValue<Length>) -> Self
fn padding_bottom(self, value: impl IntoValue<Length>) -> Self
fn margin(self, value: impl IntoValue<Length>) -> Self
fn margin_x(self, value: impl IntoValue<Length>) -> Self
fn margin_y(self, value: impl IntoValue<Length>) -> Self
fn margin_start(self, value: impl IntoValue<Length>) -> Self
fn margin_end(self, value: impl IntoValue<Length>) -> Self
fn margin_top(self, value: impl IntoValue<Length>) -> Self
fn margin_bottom(self, value: impl IntoValue<Length>) -> Self
fn grow(self, value: impl IntoValue<f32>) -> Self
fn shrink(self, value: impl IntoValue<f32>) -> Self
fn basis(self, value: impl IntoValue<Length>) -> Self
fn align_self(self, value: impl IntoValue<Align>) -> Self
Source§fn justify_self(self, value: impl IntoValue<Align>) -> Self
fn justify_self(self, value: impl IntoValue<Align>) -> Self
Source§fn top(self, value: impl IntoValue<Length>) -> Self
fn top(self, value: impl IntoValue<Length>) -> Self
absolute()).fn bottom(self, value: impl IntoValue<Length>) -> Self
Source§fn start(self, value: impl IntoValue<Length>) -> Self
fn start(self, value: impl IntoValue<Length>) -> Self
fn end(self, value: impl IntoValue<Length>) -> Self
fn grid_column(self, value: impl IntoValue<GridPlacement>) -> Self
fn grid_row(self, value: impl IntoValue<GridPlacement>) -> Self
fn direction(self, value: impl IntoValue<TextDirection>) -> Self
display the node had.fn size( self, width: impl IntoValue<Length>, height: impl IntoValue<Length>, ) -> Self
Source§fn tooltip(self, text: impl IntoValue<String>) -> Self
fn tooltip(self, text: impl IntoValue<String>) -> Self
entries, and built again whenever what it
reads changes, as Menu::children_with builds its entries.entries each time the platform opens it,
for a menu that depends on what’s selected or under the pointer at
that moment: a table row’s menu acting on the selection. What it
reads is read then, not followed.