pub struct ThemeStack { /* private fields */ }Expand description
A stack of themes for scoped style overrides.
The stack allows pushing themes that temporarily override styles, then popping them to restore previous styles. Style lookups search from top to bottom.
Implementations§
Source§impl ThemeStack
impl ThemeStack
Sourcepub fn push(&mut self, theme: Theme, inherit: bool)
pub fn push(&mut self, theme: Theme, inherit: bool)
Push a theme onto the stack.
If inherit is true, styles from the current top are merged
with the new theme’s styles.
Sourcepub fn push_theme(&mut self, theme: Theme)
pub fn push_theme(&mut self, theme: Theme)
Alias for push with inherit=true.
Sourcepub fn pop(&mut self) -> Result<(), ThemeError>
pub fn pop(&mut self) -> Result<(), ThemeError>
Pop the top theme from the stack.
Returns an error if attempting to pop the base theme.
Sourcepub fn pop_theme(&mut self) -> Result<(), ThemeError>
pub fn pop_theme(&mut self) -> Result<(), ThemeError>
Alias for pop.
Trait Implementations§
Source§impl Clone for ThemeStack
impl Clone for ThemeStack
Source§fn clone(&self) -> ThemeStack
fn clone(&self) -> ThemeStack
Returns a duplicate 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 ThemeStack
impl Debug for ThemeStack
Auto Trait Implementations§
impl Freeze for ThemeStack
impl RefUnwindSafe for ThemeStack
impl Send for ThemeStack
impl Sync for ThemeStack
impl Unpin for ThemeStack
impl UnwindSafe for ThemeStack
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