Enum zng_ext_window::WindowIcon
source · pub enum WindowIcon {
Default,
Image(ImageSource),
}
Expand description
Window icon.
Variants§
Implementations§
source§impl WindowIcon
impl WindowIcon
sourcepub fn render<I, F>(new_icon: F) -> Self
pub fn render<I, F>(new_icon: F) -> 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 copy 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<ReadOnlyVar<Img, ArcVar<Img>>> for WindowIcon
impl From<ReadOnlyVar<Img, ArcVar<Img>>> 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
source§impl IntoVar<WindowIcon> for &str
impl IntoVar<WindowIcon> for &str
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
See ImageSource
conversion from &str
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (&'static [u8], F)
impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (&'static [u8], F)
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§impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (Arc<Vec<u8>>, F)
impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (Arc<Vec<u8>>, F)
source§impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (Vec<u8>, F)
impl<F: Into<ImageDataFormat>> IntoVar<WindowIcon> for (Vec<u8>, F)
source§impl IntoVar<WindowIcon> for ImageSource
impl IntoVar<WindowIcon> for ImageSource
source§impl IntoVar<WindowIcon> for PathBuf
impl IntoVar<WindowIcon> for PathBuf
source§impl IntoVar<WindowIcon> for ImageVar
impl IntoVar<WindowIcon> for ImageVar
source§impl IntoVar<WindowIcon> for String
impl IntoVar<WindowIcon> for String
source§impl IntoVar<WindowIcon> for Txt
impl IntoVar<WindowIcon> for Txt
source§impl IntoVar<WindowIcon> for Uri
impl IntoVar<WindowIcon> for Uri
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 ImageVar
impl IntoValue<WindowIcon> for String
impl IntoValue<WindowIcon> for Txt
impl IntoValue<WindowIcon> for Uri
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 Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self
equals other
.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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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>
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