pub struct AvatarStyle {
pub background: Color,
pub text: TextStyle,
pub icon_tint: Color,
pub ring: Border,
pub size: f32,
}Expand description
Fields§
§background: ColorCircular background fill.
text: TextStyleInitials text style; its font size is rescaled during painting.
icon_tint: ColorTint applied to icon content.
ring: BorderBorder drawn around the avatar when visible.
size: f32Preferred width and height in logical pixels.
Implementations§
Source§impl AvatarStyle
impl AvatarStyle
Sourcepub fn from_theme(theme: Theme, tone: AvatarTone) -> Self
pub fn from_theme(theme: Theme, tone: AvatarTone) -> Self
Resolves tone through theme with a 40 logical-pixel default size.
Non-neutral semantic tones use a 20%-alpha tone background. Neutral and muted tones instead use theme surface colors.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{AvatarStyle, AvatarTone};
let style = AvatarStyle::from_theme(Theme::dark(), AvatarTone::Muted);
assert_eq!(style.size, 40.0);Trait Implementations§
Source§impl Clone for AvatarStyle
impl Clone for AvatarStyle
Source§fn clone(&self) -> AvatarStyle
fn clone(&self) -> AvatarStyle
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 AvatarStyle
impl Debug for AvatarStyle
Source§impl Default for AvatarStyle
impl Default for AvatarStyle
Source§impl PartialEq for AvatarStyle
impl PartialEq for AvatarStyle
impl StructuralPartialEq for AvatarStyle
Auto Trait Implementations§
impl Freeze for AvatarStyle
impl RefUnwindSafe for AvatarStyle
impl Send for AvatarStyle
impl Sync for AvatarStyle
impl Unpin for AvatarStyle
impl UnwindSafe for AvatarStyle
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.