pub struct LiquidSegmentedStyle {
pub track: Color,
pub indicator: Color,
pub label: Color,
pub selected_label: Color,
pub text: TextStyle,
pub height: f32,
}Expand description
How a crate::LiquidSegmentedControl looks. Self::system is the
system control; an app gives its controls another look with
ProvideLiquidSegmentedStyle.
ⓘ
let colors = liquid_colors();
let style = LiquidSegmentedStyle {
indicator: colors.accent,
selected_label: colors.on_accent,
..LiquidSegmentedStyle::system(&colors, &liquid_typography())
};
ProvideLiquidSegmentedStyle(style, || settings());Fields§
§track: ColorThe track under the segments.
indicator: ColorThe lens over the chosen segment at rest. A held lens clears to glass.
label: ColorThe labels of the segments.
selected_label: ColorThe label of the chosen segment while the lens rests over it. While
the lens is held, the label moves to Self::label as the indicator
clears.
text: TextStyleThe labels’ text. The chosen segment’s label is one weight heavier.
height: f32The height of the control.
Implementations§
Source§impl LiquidSegmentedStyle
impl LiquidSegmentedStyle
Sourcepub fn system(colors: &LiquidColors, typography: &LiquidTypography) -> Self
pub fn system(colors: &LiquidColors, typography: &LiquidTypography) -> Self
The system control: a white lens on a light track, or a gray lens on a dark one, with every label in the label color.
Trait Implementations§
Source§impl Clone for LiquidSegmentedStyle
impl Clone for LiquidSegmentedStyle
Source§impl Debug for LiquidSegmentedStyle
impl Debug for LiquidSegmentedStyle
Source§impl PartialEq for LiquidSegmentedStyle
impl PartialEq for LiquidSegmentedStyle
impl StructuralPartialEq for LiquidSegmentedStyle
Auto Trait Implementations§
impl Freeze for LiquidSegmentedStyle
impl RefUnwindSafe for LiquidSegmentedStyle
impl Send for LiquidSegmentedStyle
impl Sync for LiquidSegmentedStyle
impl Unpin for LiquidSegmentedStyle
impl UnsafeUnpin for LiquidSegmentedStyle
impl UnwindSafe for LiquidSegmentedStyle
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