pub struct LinkStyle {
pub text: StateStyle<TextStyle>,
pub focus_ring: Border,
pub focus_ring_offset: f32,
}Expand description
Visual states for a text link.
State styles are paint-only: keep the same font and size in every state.
LinkStyle::resolve_text enforces the normal font and size even if a
state override contains different metrics.
§Examples
use ailloli_ui_core::style::InteractionState;
use ailloli_ui_widgets::controls::LinkStyle;
let style = LinkStyle::default();
let resolved = style.resolve_text(InteractionState::default());
assert_eq!(resolved.px_size, style.text.normal.px_size);Fields§
§text: StateStyle<TextStyle>Normal and interaction-state text paint styles.
focus_ring: BorderBorder painted outside a focused, enabled link.
focus_ring_offset: f32Gap between content bounds and focus ring in logical pixels.
Implementations§
Source§impl LinkStyle
impl LinkStyle
Sourcepub fn resolve_text(&self, state: InteractionState) -> TextStyle
pub fn resolve_text(&self, state: InteractionState) -> TextStyle
Resolves the text paint for state while preserving normal metrics.
State overrides can change color and decoration, but their font and
px_size fields are deliberately ignored to keep layout stable.
§Examples
use ailloli_ui_core::style::InteractionState;
use ailloli_ui_widgets::controls::LinkStyle;
let style = LinkStyle::default();
let hovered = style.resolve_text(InteractionState {
hovered: true,
..InteractionState::default()
});
assert_eq!(hovered.px_size, style.text.normal.px_size);Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinkStyle
impl RefUnwindSafe for LinkStyle
impl Send for LinkStyle
impl Sync for LinkStyle
impl Unpin for LinkStyle
impl UnwindSafe for LinkStyle
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.