pub struct BuiltInIcons {
pub browse: fn() -> IconWidget,
pub expand: fn() -> IconWidget,
pub search: fn() -> IconWidget,
pub copy: fn() -> IconWidget,
pub clear: fn() -> IconWidget,
pub add: fn() -> IconWidget,
pub bell: fn() -> IconWidget,
pub eye: fn() -> IconWidget,
pub eye_off: fn() -> IconWidget,
pub menu: fn() -> IconWidget,
pub more: fn() -> IconWidget,
}Expand description
Icon factory set for predefined built-in buttons.
Each field is a function pointer that creates an IconWidget.
The default implementation uses SVG icons embedded in teksilo-widgets.
§Overriding
Call BuiltInIcons::set_global at app startup (before creating any
built-in buttons) to replace the default icon set:
BuiltInIcons::set_global(BuiltInIcons {
browse: || IconWidget::from_svg(MY_BROWSE_SVG),
clear: || IconWidget::from_svg(MY_CLEAR_SVG),
..BuiltInIcons::defaults()
});Fields§
§browse: fn() -> IconWidget§expand: fn() -> IconWidget§search: fn() -> IconWidget§copy: fn() -> IconWidget§clear: fn() -> IconWidget§add: fn() -> IconWidget§bell: fn() -> IconWidget§eye: fn() -> IconWidget§eye_off: fn() -> IconWidget§more: fn() -> IconWidgetImplementations§
Source§impl BuiltInIcons
impl BuiltInIcons
Sourcepub fn set_global(icons: Self)
pub fn set_global(icons: Self)
Set the global icon set. Call at app startup before creating any
built-in buttons. Can only be set once: the global is a
process-wide OnceLock, so the first set wins and any later
call is ignored (and warns). It is also locked in the first time
global() reads it, so set it before any built-in
button is created. Use defaults() with struct
update syntax to override only specific icons.
Auto Trait Implementations§
impl Freeze for BuiltInIcons
impl RefUnwindSafe for BuiltInIcons
impl Send for BuiltInIcons
impl Sync for BuiltInIcons
impl Unpin for BuiltInIcons
impl UnsafeUnpin for BuiltInIcons
impl UnwindSafe for BuiltInIcons
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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
impl<T> ErasedDestructor for Twhere
T: 'static,
§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> 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