pub struct SharedIconProvider { /* private fields */ }Expand description
Thread-safe icon provider for use in windows.
This is created from IconProviderHandle::into_shared() in App::run()
and cloned to each window.
Implementations§
Sourcepub fn from_handle(handle: IconProviderHandle) -> Self
pub fn from_handle(handle: IconProviderHandle) -> Self
Create from an IconProviderHandle (consumes the handle)
Sourcepub fn register_icon(&self, pack_name: &str, icon_name: &str, data: RefAny)
pub fn register_icon(&self, pack_name: &str, icon_name: &str, data: RefAny)
Register (or REPLACE) one icon on a live shared provider.
The registration path that exists after startup. IconProviderHandle
is consumed by Self::from_handle, so a pack built once at
App::create could never be refreshed - and it has to be: a pack whose
artwork depends on the OS theme (the desktop’s own icons, tinted with
the palette) is WRONG the moment the theme flips, and re-reading it is
the only way to get the dark variant.
Flushes the resolution cache: entries there hold the Dom the OLD artwork resolved to, and serving those back would make the re-registration invisible.
Sourcepub fn resolve(
&self,
original_icon_node: &NodeData,
icon_name: &str,
system_style: &SystemStyle,
) -> Dom
pub fn resolve( &self, original_icon_node: &NodeData, icon_name: &str, system_style: &SystemStyle, ) -> Dom
Resolve an icon to a StyledDom using the registered callback
Trait Implementations§
Source§fn clone(&self) -> SharedIconProvider
fn clone(&self) -> SharedIconProvider
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more