pub struct Style {
pub font: Font,
pub foreground: Option<Color>,
pub background: Option<Color>,
pub italic: bool,
pub underline: bool,
pub strikethrough: bool,
}Expand description
A set of text attributes for rich text formatting.
Fields§
§font: FontThe font to use.
foreground: Option<Color>The foreground (text) color.
background: Option<Color>The background color.
italic: boolWhether the text is italic.
underline: boolWhether the text has an underline.
strikethrough: boolWhether the text has a strikethrough.
Implementations§
Source§impl Style
impl Style
Sourcepub fn foreground(self, color: impl Into<Color>) -> Self
pub fn foreground(self, color: impl Into<Color>) -> Self
Sets the text color.
Sourcepub fn background(self, color: impl Into<Color>) -> Self
pub fn background(self, color: impl Into<Color>) -> Self
Sets the background color.
Sourcepub fn weight(self, weight: FontWeight) -> Self
pub fn weight(self, weight: FontWeight) -> Self
Sets the font weight.
Sourcepub const fn not_italic(self) -> Self
pub const fn not_italic(self) -> Self
Disables the italic style.
Sourcepub const fn not_underline(self) -> Self
pub const fn not_underline(self) -> Self
Disables the underline style.
Sourcepub const fn strikethrough(self) -> Self
pub const fn strikethrough(self) -> Self
Sets the strikethrough style.
Sourcepub const fn not_strikethrough(self) -> Self
pub const fn not_strikethrough(self) -> Self
Disables the strikethrough style.
Trait Implementations§
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<S> AnimationExt for Swhere
S: SignalExt,
impl<S> AnimationExt for Swhere
S: SignalExt,
Source§fn animated(self) -> WithMetadata<Self, Animation>where
Self: Sized,
fn animated(self) -> WithMetadata<Self, Animation>where
Self: Sized,
Apply default animation to this reactive value Read more
Source§fn with_animation(self, animation: Animation) -> WithMetadata<Self, Animation>where
Self: Sized,
fn with_animation(self, animation: Animation) -> WithMetadata<Self, Animation>where
Self: Sized,
Apply a specific animation to this reactive value Read more
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IdentifiableExt for T
impl<T> IdentifiableExt for T
Source§impl<C, Output> IntoSignal<Output> for C
impl<C, Output> IntoSignal<Output> for C
Source§impl<C> SignalExt for Cwhere
C: Signal,
impl<C> SignalExt for Cwhere
C: Signal,
Source§fn map<F, Output>(self, f: F) -> Map<Self, F, Output>
fn map<F, Output>(self, f: F) -> Map<Self, F, Output>
Transforms the output of this signal using the provided function.
Source§fn cached(self) -> Cached<Self>
fn cached(self) -> Cached<Self>
Wraps this signal with caching to avoid redundant computations.
Source§fn computed(self) -> Computed<Self::Output>where
Self: 'static,
fn computed(self) -> Computed<Self::Output>where
Self: 'static,
Converts this signal into a type-erased
Computed container.Source§fn with<T>(self, metadata: T) -> WithMetadata<Self, T>
fn with<T>(self, metadata: T) -> WithMetadata<Self, T>
Attaches metadata to this signal’s watcher notifications.