pub struct SegmentedStyle {Show 23 fields
pub background: Color,
pub background_hovered: Color,
pub background_pressed: Color,
pub selected_background: Color,
pub selected_background_hovered: Color,
pub selected_background_pressed: Color,
pub border: Border,
pub focus_ring: Border,
pub divider_color: Color,
pub text: TextStyle,
pub selected_text: TextStyle,
pub disabled_text: TextStyle,
pub icon_tint: Color,
pub selected_icon_tint: Color,
pub disabled_icon_tint: Color,
pub height: f32,
pub radius: Radius,
pub segment_padding_x: f32,
pub min_segment_width: f32,
pub icon_size: f32,
pub icon_gap: f32,
pub focus_ring_offset: f32,
pub disabled_opacity: f32,
}Expand description
Resolved colors, typography, and logical-pixel geometry.
selected_background_hovered and selected_background_pressed are retained
for compatibility but the current painter always uses selected_background.
Other geometry is not validated.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{SegmentedSize, SegmentedStyle};
let style = SegmentedStyle::from_theme(Theme::dark(), SegmentedSize::Compact);
assert_eq!((style.height, style.min_segment_width), (28.0, 56.0));Fields§
§background: ColorResting outer background.
background_hovered: ColorBackground while the widget is hovered.
background_pressed: ColorBackground while the widget is pressed.
selected_background: ColorSelected-segment fill.
selected_background_hovered: ColorReserved selected-hover fill; currently not read.
selected_background_pressed: ColorReserved selected-pressed fill; currently not read.
border: BorderOuter border.
focus_ring: BorderFocus border outside widget bounds.
divider_color: ColorDivider color between adjacent segments.
text: TextStyleUnselected label style.
selected_text: TextStyleSelected label style.
disabled_text: TextStyleDisabled label style.
icon_tint: ColorUnselected icon tint.
selected_icon_tint: ColorSelected icon tint.
disabled_icon_tint: ColorDisabled icon tint.
height: f32Intrinsic control height in logical pixels.
radius: RadiusOuter control corner radii.
segment_padding_x: f32Horizontal label/icon inset per segment in logical pixels.
min_segment_width: f32Minimum equal segment width in logical pixels.
icon_size: f32Optional leading icon width/height in logical pixels.
icon_gap: f32Space between icon and label in logical pixels.
focus_ring_offset: f32Focus-ring inflation beyond widget bounds in logical pixels.
disabled_opacity: f32Alpha multiplier for globally/individually disabled visuals.
Implementations§
Source§impl SegmentedStyle
impl SegmentedStyle
Sourcepub fn from_theme(theme: Theme, size: SegmentedSize) -> Self
pub fn from_theme(theme: Theme, size: SegmentedSize) -> Self
Resolves control colors and geometry from a theme and built-in size.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{SegmentedSize, SegmentedStyle};
let style = SegmentedStyle::from_theme(Theme::default(), SegmentedSize::Default);
assert_eq!((style.height, style.segment_padding_x), (34.0, 12.0));
assert_eq!((style.icon_size, style.icon_gap), (14.0, 6.0));Trait Implementations§
Source§impl Clone for SegmentedStyle
impl Clone for SegmentedStyle
Source§fn clone(&self) -> SegmentedStyle
fn clone(&self) -> SegmentedStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SegmentedStyle
impl Debug for SegmentedStyle
Source§impl Default for SegmentedStyle
impl Default for SegmentedStyle
Source§impl PartialEq for SegmentedStyle
impl PartialEq for SegmentedStyle
impl StructuralPartialEq for SegmentedStyle
Auto Trait Implementations§
impl Freeze for SegmentedStyle
impl RefUnwindSafe for SegmentedStyle
impl Send for SegmentedStyle
impl Sync for SegmentedStyle
impl Unpin for SegmentedStyle
impl UnwindSafe for SegmentedStyle
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
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.