pub struct Style {
pub effects: Effects,
pub color: ColorStyle,
}Expand description
Combine a color and effects.
Represents any transformation that can be applied to text.
This is a “abstract” style, which can depend on the current theme, or on the previously active style.
Fields§
§effects: EffectsEffects to apply.
color: ColorStyleColor style to apply.
Implementations§
Source§impl Style
impl Style
Sourcepub const fn none() -> Style
pub const fn none() -> Style
Returns a new Style that doesn’t apply anything.
Same as Style::inherit_parent().
Sourcepub fn merge(styles: &[Style]) -> Style
pub fn merge(styles: &[Style]) -> Style
Returns a new Style by merging all given styles.
Will use the last non-None color, and will combine all effects.
Sourcepub const fn from_color_style(color: ColorStyle) -> Style
pub const fn from_color_style(color: ColorStyle) -> Style
Create a new Style from a single ColorStyle and no effect.
Sourcepub const fn inherit_parent() -> Style
pub const fn inherit_parent() -> Style
Uses ColorType::InheritParent for both front and background.
Sourcepub const fn terminal_default() -> Style
pub const fn terminal_default() -> Style
Style set by terminal before entering a Cursive program.
Sourcepub const fn background() -> Style
pub const fn background() -> Style
Application background, where no view is present.
Sourcepub const fn title_primary() -> Style
pub const fn title_primary() -> Style
Title text color with default background.
Sourcepub const fn title_secondary() -> Style
pub const fn title_secondary() -> Style
Alternative color for a title.
Sourcepub const fn highlight_inactive() -> Style
pub const fn highlight_inactive() -> Style
Returns an inactive highlight style.
Sourcepub fn resolve(
&self,
palette: &Palette,
previous: ConcreteStyle,
) -> ConcreteStyle
pub fn resolve( &self, palette: &Palette, previous: ConcreteStyle, ) -> ConcreteStyle
Resolve a style to a concrete style.
Trait Implementations§
Source§impl From<ColorStyle> for Style
impl From<ColorStyle> for Style
Source§fn from(color: ColorStyle) -> Style
fn from(color: ColorStyle) -> Style
Source§impl From<PaletteColor> for Style
impl From<PaletteColor> for Style
Source§fn from(color: PaletteColor) -> Style
fn from(color: PaletteColor) -> Style
Source§impl<'a> FromIterator<&'a Style> for Style
Creates a new Style by merging all given styles.
impl<'a> FromIterator<&'a Style> for Style
Creates a new Style by merging all given styles.
Will use the last non-None color, and will combine all effects.
Source§impl<T> FromIterator<T> for Style
Creates a new Style by merging all given styles.
impl<T> FromIterator<T> for Style
Creates a new Style by merging all given styles.
Will use the last non-None color, and will combine all effects.
Source§impl Resolvable for Style
impl Resolvable for Style
impl Copy for Style
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnwindSafe for Style
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.