pub struct ButtonGroupItem { /* private fields */ }Expand description
One entry with a stable, caller-provided identifier.
Implementations§
Source§impl ButtonGroupItem
impl ButtonGroupItem
Sourcepub fn new(
id: impl Into<SharedString>,
label: impl Into<SharedString>,
) -> ButtonGroupItem
pub fn new( id: impl Into<SharedString>, label: impl Into<SharedString>, ) -> ButtonGroupItem
Creates a button group member with a stable id and visible/accessible label.
Sourcepub fn disabled(self, disabled: bool) -> ButtonGroupItem
pub fn disabled(self, disabled: bool) -> ButtonGroupItem
Disables activation and selection toggling for this member when true.
Sourcepub fn on_activate(
self,
callback: impl Fn(&mut Window, &mut App) + 'static,
) -> ButtonGroupItem
pub fn on_activate( self, callback: impl Fn(&mut Window, &mut App) + 'static, ) -> ButtonGroupItem
Runs in action groups. Selection groups use the group’s on_change callback.
Sourcepub fn action(
self,
callback: impl Fn(&mut Window, &mut App) + 'static,
) -> ButtonGroupItem
pub fn action( self, callback: impl Fn(&mut Window, &mut App) + 'static, ) -> ButtonGroupItem
Adds a command that remains independent of the group’s selection mode.
Sourcepub fn toggle(
self,
selected: bool,
callback: impl Fn(bool, &mut Window, &mut App) + 'static,
) -> ButtonGroupItem
pub fn toggle( self, selected: bool, callback: impl Fn(bool, &mut Window, &mut App) + 'static, ) -> ButtonGroupItem
Adds a toggle whose checked value is controlled independently of the group.
Sourcepub fn leading_icon<E>(self, icon: impl Fn() -> E + 'static) -> ButtonGroupItemwhere
E: IntoElement,
pub fn leading_icon<E>(self, icon: impl Fn() -> E + 'static) -> ButtonGroupItemwhere
E: IntoElement,
Displays a leading icon alongside the member’s label.
Sourcepub fn icon_only<E>(self, icon: impl Fn() -> E + 'static) -> ButtonGroupItemwhere
E: IntoElement,
pub fn icon_only<E>(self, icon: impl Fn() -> E + 'static) -> ButtonGroupItemwhere
E: IntoElement,
Renders this member as an icon-only button while retaining label for accessibility and overflow.
Sourcepub fn icon_width(self, width: IconButtonWidth) -> ButtonGroupItem
pub fn icon_width(self, width: IconButtonWidth) -> ButtonGroupItem
Sets the width preset used when this member is rendered as an icon-only button.
Sourcepub fn content<E>(
self,
width: Pixels,
content: impl Fn() -> E + 'static,
) -> ButtonGroupItemwhere
E: IntoElement,
pub fn content<E>(
self,
width: Pixels,
content: impl Fn() -> E + 'static,
) -> ButtonGroupItemwhere
E: IntoElement,
Replaces row content with decorative artwork of the supplied preferred width.
Sourcepub fn overflow_item_content<E>(
self,
content: impl Fn() -> E + 'static,
) -> ButtonGroupItemwhere
E: IntoElement,
pub fn overflow_item_content<E>(
self,
content: impl Fn() -> E + 'static,
) -> ButtonGroupItemwhere
E: IntoElement,
Replaces the menu row’s visible label. The member owns activation and its accessible name.
Sourcepub fn variant(self, variant: ButtonVariant) -> ButtonGroupItem
pub fn variant(self, variant: ButtonVariant) -> ButtonGroupItem
Overrides the group’s default ButtonVariant for this member.
Sourcepub fn tone(self, tone: SemanticTone) -> ButtonGroupItem
pub fn tone(self, tone: SemanticTone) -> ButtonGroupItem
Overrides the semantic tone for this member (both inline and in the overflow menu).
Sourcepub fn style(self, style: ButtonSegmentStyle) -> ButtonGroupItem
pub fn style(self, style: ButtonSegmentStyle) -> ButtonGroupItem
Applies per-member visual style overrides.
Sourcepub fn weight(self, weight: f32) -> ButtonGroupItem
pub fn weight(self, weight: f32) -> ButtonGroupItem
Shares available space with other weighted members. Zero weight keeps intrinsic sizing.
Sourcepub fn compression_limit(self, limit: Pixels) -> ButtonGroupItem
pub fn compression_limit(self, limit: Pixels) -> ButtonGroupItem
Limits how many logical pixels a neighbor can borrow from this member.
Sourcepub fn vertical_alignment(
self,
alignment: ButtonGroupVerticalAlignment,
) -> ButtonGroupItem
pub fn vertical_alignment( self, alignment: ButtonGroupVerticalAlignment, ) -> ButtonGroupItem
Overrides the group’s vertical cross-axis alignment for this member.
Sourcepub fn interaction_source(
self,
source: &Entity<InteractionSource>,
) -> ButtonGroupItem
pub fn interaction_source( self, source: &Entity<InteractionSource>, ) -> ButtonGroupItem
Shares the member’s interaction state, including press-driven width changes.
Auto Trait Implementations§
impl !RefUnwindSafe for ButtonGroupItem
impl !Send for ButtonGroupItem
impl !Sync for ButtonGroupItem
impl !UnwindSafe for ButtonGroupItem
impl Forget for ButtonGroupItem
impl Freeze for ButtonGroupItemwhere
&'static str: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const RcInner<dyn Fn(&mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut Window, &mut App)>>: Freeze,
*const RcInner<dyn Fn(bool, &mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(bool, &mut Window, &mut App)>>: Freeze,
*const RcInner<dyn Fn() -> AnyElement> is !null: Freeze,
PhantomData<RcInner<dyn Fn() -> AnyElement>>: Freeze,
NonZero<u32>: Freeze,
*const (): Freeze,
*const ArcInner<RwLock<RawRwLock, EntityRefCounts>> is !null: Freeze,
PhantomData<fn(InteractionSource) -> InteractionSource>: Freeze,
impl Move for ButtonGroupItem
impl Unpin for ButtonGroupItem
impl UnsafeUnpin for ButtonGroupItemwhere
&'static str: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut Window, &mut App)>>: UnsafeUnpin,
*const RcInner<dyn Fn(bool, &mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(bool, &mut Window, &mut App)>>: UnsafeUnpin,
*const RcInner<dyn Fn() -> AnyElement> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn() -> AnyElement>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const (): UnsafeUnpin,
*const ArcInner<RwLock<RawRwLock, EntityRefCounts>> is !null: UnsafeUnpin,
PhantomData<fn(InteractionSource) -> InteractionSource>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more