#[non_exhaustive]pub enum WindowIcon {
Default,
Image(ImageSource),
}Expand description
Window icon.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Source§impl WindowIcon
impl WindowIcon
Sourcepub fn render(
new_icon: impl Fn() -> UiNode + Send + Sync + 'static,
) -> WindowIcon
pub fn render( new_icon: impl Fn() -> UiNode + Send + Sync + 'static, ) -> WindowIcon
New window icon from a closure that generates a new icon UiNode for the window.
The closure is called once on init and every time the window icon property changes, the closure runs in a headless window context, it must return a node to be rendered as an icon.
The icon node is deinited and dropped after the first render, you can enable image::render_retain on it
to cause the icon to continue rendering on updates.
§Examples
WindowIcon::render(|| {
Container! {
// image::render_retain = true;
size = (36, 36);
background_gradient = Line::to_bottom_right(), stops![colors::MIDNIGHT_BLUE, 70.pct(), colors::CRIMSON];
corner_radius = 6;
font_size = 28;
font_weight = FontWeight::BOLD;
child = Text!("A");
}
})Trait Implementations§
Source§impl Clone for WindowIcon
impl Clone for WindowIcon
Source§fn clone(&self) -> WindowIcon
fn clone(&self) -> WindowIcon
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowIcon
impl Debug for WindowIcon
Source§impl Default for WindowIcon
impl Default for WindowIcon
Source§impl From<&'static [u8]> for WindowIcon
impl From<&'static [u8]> for WindowIcon
Source§impl From<&Path> for WindowIcon
impl From<&Path> for WindowIcon
Source§fn from(path: &Path) -> WindowIcon
fn from(path: &Path) -> WindowIcon
Source§impl From<&str> for WindowIcon
impl From<&str> for WindowIcon
Source§fn from(s: &str) -> WindowIcon
fn from(s: &str) -> WindowIcon
See ImageSource conversion from &str
Source§impl<F> From<(&'static [u8], F)> for WindowIconwhere
F: Into<ImageDataFormat>,
impl<F> From<(&'static [u8], F)> for WindowIconwhere
F: Into<ImageDataFormat>,
Source§fn from(_: (&'static [u8], F)) -> WindowIcon
fn from(_: (&'static [u8], F)) -> WindowIcon
From encoded data of known format.
Source§impl<F, const N: usize> From<(&'static [u8; N], F)> for WindowIconwhere
F: Into<ImageDataFormat>,
impl<F, const N: usize> From<(&'static [u8; N], F)> for WindowIconwhere
F: Into<ImageDataFormat>,
Source§impl<F> From<(Arc<Vec<u8>>, F)> for WindowIconwhere
F: Into<ImageDataFormat>,
impl<F> From<(Arc<Vec<u8>>, F)> for WindowIconwhere
F: Into<ImageDataFormat>,
Source§impl<F> From<(Vec<u8>, F)> for WindowIconwhere
F: Into<ImageDataFormat>,
impl<F> From<(Vec<u8>, F)> for WindowIconwhere
F: Into<ImageDataFormat>,
Source§impl From<ImageSource> for WindowIcon
impl From<ImageSource> for WindowIcon
Source§fn from(source: ImageSource) -> WindowIcon
fn from(source: ImageSource) -> WindowIcon
Source§impl From<PathBuf> for WindowIcon
impl From<PathBuf> for WindowIcon
Source§fn from(path: PathBuf) -> WindowIcon
fn from(path: PathBuf) -> WindowIcon
Source§impl From<String> for WindowIcon
impl From<String> for WindowIcon
Source§fn from(s: String) -> WindowIcon
fn from(s: String) -> WindowIcon
Same as conversion from &str.
Source§impl From<Txt> for WindowIcon
impl From<Txt> for WindowIcon
Source§fn from(s: Txt) -> WindowIcon
fn from(s: Txt) -> WindowIcon
Same as conversion from &str.
Source§impl From<Uri> for WindowIcon
impl From<Uri> for WindowIcon
Source§fn from(uri: Uri) -> WindowIcon
fn from(uri: Uri) -> WindowIcon
Source§impl IntoVar<WindowIcon> for &'static [u8]
impl IntoVar<WindowIcon> for &'static [u8]
Source§impl IntoVar<WindowIcon> for &Path
impl IntoVar<WindowIcon> for &Path
fn into_var(self) -> Var<WindowIcon>
Source§impl IntoVar<WindowIcon> for &str
impl IntoVar<WindowIcon> for &str
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
See ImageSource conversion from &str
Source§impl<F> IntoVar<WindowIcon> for (&'static [u8], F)where
F: Into<ImageDataFormat>,
impl<F> IntoVar<WindowIcon> for (&'static [u8], F)where
F: Into<ImageDataFormat>,
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
From encoded data of known format.
Source§impl<F, const N: usize> IntoVar<WindowIcon> for (&'static [u8; N], F)where
F: Into<ImageDataFormat>,
impl<F, const N: usize> IntoVar<WindowIcon> for (&'static [u8; N], F)where
F: Into<ImageDataFormat>,
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
From encoded data of known format.
Source§impl<F> IntoVar<WindowIcon> for (Arc<Vec<u8>>, F)where
F: Into<ImageDataFormat>,
impl<F> IntoVar<WindowIcon> for (Arc<Vec<u8>>, F)where
F: Into<ImageDataFormat>,
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
From encoded data of known format.
Source§impl<F> IntoVar<WindowIcon> for (Vec<u8>, F)where
F: Into<ImageDataFormat>,
impl<F> IntoVar<WindowIcon> for (Vec<u8>, F)where
F: Into<ImageDataFormat>,
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
From encoded data of known format.
Source§impl IntoVar<WindowIcon> for ImageSource
impl IntoVar<WindowIcon> for ImageSource
fn into_var(self) -> Var<WindowIcon>
Source§impl IntoVar<WindowIcon> for PathBuf
impl IntoVar<WindowIcon> for PathBuf
fn into_var(self) -> Var<WindowIcon>
Source§impl IntoVar<WindowIcon> for String
impl IntoVar<WindowIcon> for String
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
Same as conversion from &str.
Source§impl IntoVar<WindowIcon> for Txt
impl IntoVar<WindowIcon> for Txt
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
Same as conversion from &str.
Source§impl IntoVar<WindowIcon> for Uri
impl IntoVar<WindowIcon> for Uri
fn into_var(self) -> Var<WindowIcon>
Source§impl PartialEq for WindowIcon
impl PartialEq for WindowIcon
impl IntoValue<WindowIcon> for &'static [u8]
impl<const N: usize> IntoValue<WindowIcon> for &'static [u8; N]
impl IntoValue<WindowIcon> for &Path
impl IntoValue<WindowIcon> for &str
impl<F> IntoValue<WindowIcon> for (&'static [u8], F)where
F: Into<ImageDataFormat>,
impl<F, const N: usize> IntoValue<WindowIcon> for (&'static [u8; N], F)where
F: Into<ImageDataFormat>,
impl<F> IntoValue<WindowIcon> for (Arc<Vec<u8>>, F)where
F: Into<ImageDataFormat>,
impl<F> IntoValue<WindowIcon> for (Vec<u8>, F)where
F: Into<ImageDataFormat>,
impl IntoValue<WindowIcon> for Arc<Vec<u8>>
impl IntoValue<WindowIcon> for ImageSource
impl IntoValue<WindowIcon> for PathBuf
impl IntoValue<WindowIcon> for String
impl IntoValue<WindowIcon> for Txt
impl IntoValue<WindowIcon> for Uri
impl IntoValue<WindowIcon> for Var<Img>
impl IntoValue<WindowIcon> for Vec<u8>
impl StructuralPartialEq for WindowIcon
Auto Trait Implementations§
impl !Freeze for WindowIcon
impl !RefUnwindSafe for WindowIcon
impl Send for WindowIcon
impl Sync for WindowIcon
impl !Unpin for WindowIcon
impl !UnwindSafe for WindowIcon
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().