pub struct CheckboxStyle {
pub box_bg: Color,
pub checked_bg: Color,
pub box_border: Color,
pub checked_border: Color,
pub box_radius: f32,
pub box_size: f32,
pub gap: f32,
pub label_color: Color,
pub label_px: u16,
pub icon_tint: Color,
}Expand description
Colors, typography, and logical-pixel metrics used by draw_checkbox.
The style is a value-level drawing configuration. It does not store checked, disabled, hover, or focus state.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::CheckboxStyle;
let style = CheckboxStyle::from_theme(Theme::dark());
assert_eq!(style.box_size, 18.0);
assert_eq!(style.label_px, 13);Fields§
§box_bg: ColorUnchecked box fill color.
checked_bg: ColorChecked box fill color.
box_border: ColorUnchecked box border color.
checked_border: ColorChecked box border color.
box_radius: f32Box corner radius in logical pixels.
box_size: f32Width and height of the square box in logical pixels.
gap: f32Horizontal gap between the box and label in logical pixels.
label_color: ColorLabel text color.
label_px: u16Label font size in logical pixels.
icon_tint: ColorCheckmark icon color.
Implementations§
Source§impl CheckboxStyle
impl CheckboxStyle
Sourcepub fn from_theme(theme: Theme) -> Self
pub fn from_theme(theme: Theme) -> Self
Resolves a checkbox style from theme’s current palette.
The method uses fixed logical-pixel defaults for geometry and typography; only colors are derived from the theme.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::CheckboxStyle;
let style = CheckboxStyle::from_theme(Theme::dark());
assert_eq!(style.box_radius, 4.0);
assert_eq!(style.gap, 8.0);Trait Implementations§
Source§impl Clone for CheckboxStyle
impl Clone for CheckboxStyle
Source§fn clone(&self) -> CheckboxStyle
fn clone(&self) -> CheckboxStyle
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 CheckboxStyle
impl Debug for CheckboxStyle
Source§impl Default for CheckboxStyle
impl Default for CheckboxStyle
impl Copy for CheckboxStyle
Auto Trait Implementations§
impl Freeze for CheckboxStyle
impl RefUnwindSafe for CheckboxStyle
impl Send for CheckboxStyle
impl Sync for CheckboxStyle
impl Unpin for CheckboxStyle
impl UnwindSafe for CheckboxStyle
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.