pub struct Theme {
pub text_palette: EzPalette,
pub main_palette: EzPalette,
pub accent_palette: EzPalette,
pub default_style: Style,
pub alternate_style: Option<Style>,
pub default_border_theme: BorderTheme,
pub alternate_border_theme: Option<BorderTheme>,
}Expand description
Holds some commonly used style across your application
Fields§
§text_palette: EzPaletteThe text color of the application
main_palette: EzPaletteThe main color of the application. This will be used mainly for blocks borders
accent_palette: EzPaletteAn accent color mainly used for focused blocks.
default_style: StyleA common style applied everywhere we can
alternate_style: Option<Style>An alternate version of the default style. This is used for focused blocks.
default_border_theme: BorderThemeA common style for all borders
alternate_border_theme: Option<BorderTheme>An alternate version of the default border theme. This is used for focused blocks.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn block<'a>(&self, overide: Option<&Props>) -> Block<'a>
pub fn block<'a>(&self, overide: Option<&Props>) -> Block<'a>
Create a new block themed depending on its focus
Sourcepub fn get_reversed_style(&self, overide: Option<&Props>) -> Style
pub fn get_reversed_style(&self, overide: Option<&Props>) -> Style
Get the style for a given focus flag
Sourcepub fn get_border(&self, overide: Option<&Props>) -> BorderTheme
pub fn get_border(&self, overide: Option<&Props>) -> BorderTheme
Get the border theme for a given focus flag
Sourcepub fn main_or_accent(&self, condition: bool) -> EzPalette
pub fn main_or_accent(&self, condition: bool) -> EzPalette
Sourcepub fn main_or_text(&self, condition: bool) -> EzPalette
pub fn main_or_text(&self, condition: bool) -> EzPalette
Sourcepub fn accent_or_text(&self, condition: bool) -> EzPalette
pub fn accent_or_text(&self, condition: bool) -> EzPalette
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
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> 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