cosmic::widget::segmented_button

Trait SegmentedVariant

Source
pub trait SegmentedVariant {
    // Required methods
    fn variant_appearance(theme: &Theme, style: &SegmentedButton) -> Appearance;
    fn variant_bounds<'b>(
        &'b self,
        state: &'b LocalState,
        bounds: Rectangle,
    ) -> Box<dyn Iterator<Item = ItemBounds> + 'b>;
    fn variant_layout(
        &self,
        state: &mut LocalState,
        renderer: &Renderer,
        limits: &Limits,
    ) -> Size;
}
Expand description

Isolates variant-specific behaviors from SegmentedButton.

Required Methods§

Source

fn variant_appearance(theme: &Theme, style: &SegmentedButton) -> Appearance

Get the appearance for this variant of the widget.

Source

fn variant_bounds<'b>( &'b self, state: &'b LocalState, bounds: Rectangle, ) -> Box<dyn Iterator<Item = ItemBounds> + 'b>

Calculates the bounds for visible buttons.

Source

fn variant_layout( &self, state: &mut LocalState, renderer: &Renderer, limits: &Limits, ) -> Size

Calculates the layout of this variant.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, SelectionMode, Message> SegmentedVariant for SegmentedButton<'a, Horizontal, SelectionMode, Message>
where Model<SelectionMode>: Selectable, SelectionMode: Default,

Source§

impl<'a, SelectionMode, Message> SegmentedVariant for SegmentedButton<'a, Vertical, SelectionMode, Message>
where Model<SelectionMode>: Selectable, SelectionMode: Default,