pub struct StatusStyle {
pub color: Color,
pub muted_color: Color,
pub size: f32,
pub ring_width: f32,
pub bar_gap: f32,
}Expand description
Resolved colors and logical-pixel metrics for a StatusIndicator.
muted_color is retained for style compatibility but is not currently
painted by any variant.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{StatusStyle, StatusTone};
let style = StatusStyle::from_theme(Theme::dark(), StatusTone::Info);
assert_eq!(style.size, 10.0);
assert_eq!(style.ring_width, 2.0);Fields§
§color: ColorPrimary dot, ring, or bars color.
muted_color: ColorReserved secondary color; currently not painted.
size: f32Preferred height, and width for dot/ring, in logical pixels.
ring_width: f32Ring border width in logical pixels.
bar_gap: f32Horizontal gap between bars in logical pixels.
Implementations§
Source§impl StatusStyle
impl StatusStyle
Sourcepub fn from_theme(theme: Theme, tone: StatusTone) -> Self
pub fn from_theme(theme: Theme, tone: StatusTone) -> Self
Resolves tone through theme with the default indicator metrics.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{StatusStyle, StatusTone};
let style = StatusStyle::from_theme(Theme::dark(), StatusTone::Warning);
assert_eq!(style.bar_gap, 3.0);Trait Implementations§
Source§impl Clone for StatusStyle
impl Clone for StatusStyle
Source§fn clone(&self) -> StatusStyle
fn clone(&self) -> StatusStyle
Returns a copy 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 StatusStyle
impl Debug for StatusStyle
Source§impl Default for StatusStyle
impl Default for StatusStyle
Source§impl PartialEq for StatusStyle
impl PartialEq for StatusStyle
impl StructuralPartialEq for StatusStyle
Auto Trait Implementations§
impl Freeze for StatusStyle
impl RefUnwindSafe for StatusStyle
impl Send for StatusStyle
impl Sync for StatusStyle
impl Unpin for StatusStyle
impl UnwindSafe for StatusStyle
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.