Enum zng::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) -> WindowIcon
pub fn render<I, F>(new_icon: F) -> 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
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 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
Converts to this type from the input type.
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
Converts to this type from the input type.
source§impl From<PathBuf> for WindowIcon
impl From<PathBuf> for WindowIcon
source§fn from(path: PathBuf) -> WindowIcon
fn from(path: PathBuf) -> WindowIcon
Converts to this type from the input type.
source§impl From<ReadOnlyVar<Img, ArcVar<Img>>> for WindowIcon
impl From<ReadOnlyVar<Img, ArcVar<Img>>> for WindowIcon
source§fn from(image: ReadOnlyVar<Img, ArcVar<Img>>) -> WindowIcon
fn from(image: ReadOnlyVar<Img, ArcVar<Img>>) -> WindowIcon
Converts to this type from the input type.
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
Converts to this type from the input type.
source§impl IntoVar<WindowIcon> for &'static [u8]
impl IntoVar<WindowIcon> for &'static [u8]
source§impl<const N: usize> IntoVar<WindowIcon> for &'static [u8; N]
impl<const N: usize> IntoVar<WindowIcon> for &'static [u8; N]
source§impl IntoVar<WindowIcon> for &Path
impl IntoVar<WindowIcon> for &Path
source§fn into_var(self) -> <&Path as IntoVar<WindowIcon>>::Var
fn into_var(self) -> <&Path as IntoVar<WindowIcon>>::Var
Converts the source value into a var.
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 IntoVar<WindowIcon> for &str
impl IntoVar<WindowIcon> for &str
source§fn into_var(self) -> <&str as IntoVar<WindowIcon>>::Var
fn into_var(self) -> <&str as IntoVar<WindowIcon>>::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> 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) -> <(&'static [u8], F) as IntoVar<WindowIcon>>::Var
fn into_var(self) -> <(&'static [u8], F) as IntoVar<WindowIcon>>::Var
From encoded data of known format.
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, 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) -> <(&'static [u8; N], F) as IntoVar<WindowIcon>>::Var
fn into_var(self) -> <(&'static [u8; N], F) as IntoVar<WindowIcon>>::Var
From encoded data of known format.
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> 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§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) -> <(Vec<u8>, F) as IntoVar<WindowIcon>>::Var
fn into_var(self) -> <(Vec<u8>, F) as IntoVar<WindowIcon>>::Var
From encoded data of known format.
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 IntoVar<WindowIcon> for Arc<Vec<u8>>
impl IntoVar<WindowIcon> for Arc<Vec<u8>>
source§impl IntoVar<WindowIcon> for ImageSource
impl IntoVar<WindowIcon> for ImageSource
source§fn into_var(self) -> <ImageSource as IntoVar<WindowIcon>>::Var
fn into_var(self) -> <ImageSource as IntoVar<WindowIcon>>::Var
Converts the source value into a var.
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 IntoVar<WindowIcon> for PathBuf
impl IntoVar<WindowIcon> for PathBuf
source§fn into_var(self) -> <PathBuf as IntoVar<WindowIcon>>::Var
fn into_var(self) -> <PathBuf as IntoVar<WindowIcon>>::Var
Converts the source value into a var.
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 IntoVar<WindowIcon> for ReadOnlyVar<Img, ArcVar<Img>>
impl IntoVar<WindowIcon> for ReadOnlyVar<Img, ArcVar<Img>>
source§fn into_var(self) -> <ReadOnlyVar<Img, ArcVar<Img>> as IntoVar<WindowIcon>>::Var
fn into_var(self) -> <ReadOnlyVar<Img, ArcVar<Img>> as IntoVar<WindowIcon>>::Var
Converts the source value into a var.
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 IntoVar<WindowIcon> for String
impl IntoVar<WindowIcon> for String
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 IntoVar<WindowIcon> for Txt
impl IntoVar<WindowIcon> for Txt
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 IntoVar<WindowIcon> for Uri
impl IntoVar<WindowIcon> for Uri
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 IntoVar<WindowIcon> for Vec<u8>
impl IntoVar<WindowIcon> for Vec<u8>
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 ReadOnlyVar<Img, ArcVar<Img>>
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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> 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>
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
.§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
.§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.§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.§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>
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§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
The none-equivalent value.
§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
The none-equivalent value.
§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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.