pub struct ThemeRegistry { /* private fields */ }Expand description
An ordered set of named themes (built-ins first, then custom), resolved by name. Cloned cheaply enough for the few entries a UI carries.
Implementations§
Source§impl ThemeRegistry
impl ThemeRegistry
Sourcepub fn builtin() -> ThemeRegistry
pub fn builtin() -> ThemeRegistry
A registry with only the built-in themes.
Sourcepub fn with_custom<I>(self, custom: I) -> ThemeRegistry
pub fn with_custom<I>(self, custom: I) -> ThemeRegistry
Adds custom themes, each replacing a built-in of the same name in place (keeping its position) or appended after the built-ins.
Sourcepub fn get(&self, name: &str) -> Option<ThemeColors>
pub fn get(&self, name: &str) -> Option<ThemeColors>
The colors for name, if present.
Sourcepub fn resolve(&self, name: &str) -> ThemeColors
pub fn resolve(&self, name: &str) -> ThemeColors
The colors for name, falling back to the default theme when unknown.
Trait Implementations§
Source§impl Clone for ThemeRegistry
impl Clone for ThemeRegistry
Source§fn clone(&self) -> ThemeRegistry
fn clone(&self) -> ThemeRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ThemeRegistry
impl RefUnwindSafe for ThemeRegistry
impl Send for ThemeRegistry
impl Sync for ThemeRegistry
impl Unpin for ThemeRegistry
impl UnsafeUnpin for ThemeRegistry
impl UnwindSafe for ThemeRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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