#[non_exhaustive]pub enum WindowIcon {
Default,
Image(ImageSource),
}
Expand description
Window icon.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl WindowIcon
impl WindowIcon
Sourcepub fn render(new_icon: impl Fn() -> UiNode + Send + Sync + 'static) -> Self
pub fn render(new_icon: impl Fn() -> UiNode + Send + Sync + 'static) -> Self
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WindowIcon
impl Debug 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§impl From<&str> for WindowIcon
impl From<&str> for WindowIcon
Source§fn from(s: &str) -> Self
fn from(s: &str) -> Self
See ImageSource
conversion from &str
Source§impl<F: Into<ImageDataFormat>> From<(&'static [u8], F)> for WindowIcon
impl<F: Into<ImageDataFormat>> From<(&'static [u8], F)> for WindowIcon
Source§impl<F: Into<ImageDataFormat>, const N: usize> From<(&'static [u8; N], F)> for WindowIcon
impl<F: Into<ImageDataFormat>, const N: usize> From<(&'static [u8; N], F)> for WindowIcon
Source§impl<F: Into<ImageDataFormat>> From<(Arc<Vec<u8>>, F)> for WindowIcon
impl<F: Into<ImageDataFormat>> From<(Arc<Vec<u8>>, F)> for WindowIcon
Source§impl<F: Into<ImageDataFormat>> From<(Vec<u8>, F)> for WindowIcon
impl<F: Into<ImageDataFormat>> From<(Vec<u8>, F)> for WindowIcon
Source§impl From<ImageSource> for WindowIcon
impl From<ImageSource> for WindowIcon
Source§fn from(source: ImageSource) -> Self
fn from(source: ImageSource) -> Self
Converts to this type from the input type.
Source§impl From<PathBuf> for WindowIcon
impl From<PathBuf> for WindowIcon
Source§impl From<String> for WindowIcon
impl From<String> for WindowIcon
Source§impl From<Uri> for WindowIcon
impl From<Uri> for 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: Into<ImageDataFormat>> IntoVar<WindowIcon> for (&'static [u8], F)
impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (&'static [u8], F)
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
From encoded data of known format.
Source§impl<F: Into<ImageDataFormat>, const N: usize> IntoVar<WindowIcon> for (&'static [u8; N], F)
impl<F: Into<ImageDataFormat>, const N: usize> IntoVar<WindowIcon> for (&'static [u8; N], F)
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
From encoded data of known format.
Source§impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (Arc<Vec<u8>>, F)
impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (Arc<Vec<u8>>, F)
Source§fn into_var(self) -> Var<WindowIcon>
fn into_var(self) -> Var<WindowIcon>
From encoded data of known format.
Source§impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (Vec<u8>, F)
impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (Vec<u8>, F)
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 IntoVar<WindowIcon> for ImageVar
impl IntoVar<WindowIcon> for ImageVar
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: Into<ImageDataFormat>> IntoValue<WindowIcon> for (&'static [u8], F)
impl<F: Into<ImageDataFormat>, const N: usize> IntoValue<WindowIcon> for (&'static [u8; N], F)
impl<F: Into<ImageDataFormat>> IntoValue<WindowIcon> for (Arc<Vec<u8>>, F)
impl<F: Into<ImageDataFormat>> IntoValue<WindowIcon> for (Vec<u8>, F)
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 ImageVar
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§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Clone the value.
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
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
Swap value with
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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>
Converts
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>
Converts
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