Trait cosmic::widget::segmented_button::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.

Object Safety§

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,