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§
sourcefn variant_appearance(theme: &Theme, style: &SegmentedButton) -> Appearance
fn variant_appearance(theme: &Theme, style: &SegmentedButton) -> Appearance
Get the appearance for this variant of the widget.
sourcefn variant_bounds<'b>(
&'b self,
state: &'b LocalState,
bounds: Rectangle,
) -> Box<dyn Iterator<Item = ItemBounds> + 'b>
fn variant_bounds<'b>( &'b self, state: &'b LocalState, bounds: Rectangle, ) -> Box<dyn Iterator<Item = ItemBounds> + 'b>
Calculates the bounds for visible buttons.
sourcefn variant_layout(
&self,
state: &mut LocalState,
renderer: &Renderer,
limits: &Limits,
) -> Size
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.