pub struct ToggleButtonGroup { /* private fields */ }Implementations§
Source§impl ToggleButtonGroup
impl ToggleButtonGroup
Sourcepub fn orientation(self, orientation: SelectionOrientation) -> Self
pub fn orientation(self, orientation: SelectionOrientation) -> Self
orientation — lays the group out along the given axis.
Sourcepub fn disallow_empty_selection(self, v: bool) -> Self
pub fn disallow_empty_selection(self, v: bool) -> Self
disallowEmptySelection — keeps at least one member selected.
Sourcepub fn on_selection_change(
self,
handler: impl Fn(&[SharedString], &mut Window, &mut App) + 'static,
) -> Self
pub fn on_selection_change( self, handler: impl Fn(&[SharedString], &mut Window, &mut App) + 'static, ) -> Self
onSelectionChange — the v3 name for ToggleButtonGroup::on_change.
pub fn new(id: impl Into<ElementId>) -> Self
pub fn selection_mode(self, m: SelectionMode) -> Self
Sourcepub fn size(self, size: Size) -> Self
pub fn size(self, size: Size) -> Self
size — inherited by children that do not set their own size.
Sourcepub fn is_disabled(self, v: bool) -> Self
pub fn is_disabled(self, v: bool) -> Self
isDisabled — disables every child, matching React Aria’s group state.
Sourcepub fn separators(self, v: bool) -> Self
pub fn separators(self, v: bool) -> Self
ToggleButtonGroup.Separator — the hairline between members.
pub fn is_detached(self, v: bool) -> Self
pub fn full_width(self, v: bool) -> Self
Sourcepub fn sx(self, style: impl FnOnce(Div) -> Div) -> Self
pub fn sx(self, style: impl FnOnce(Div) -> Div) -> Self
The one slot for caller-owned low-level styling: GPUI’s styling methods
(bg, text_color, w, h, p, rounded, border_color, …)
applied to the group’s root element after every value the orientation and
the active theme chose, so they win. It restyles the row the members sit
in; each member keeps its own sx slot.
pub fn selected_keys( self, keys: impl IntoIterator<Item = impl Into<SharedString>>, ) -> Self
Sourcepub fn default_selected_keys(
self,
keys: impl IntoIterator<Item = impl Into<SharedString>>,
) -> Self
pub fn default_selected_keys( self, keys: impl IntoIterator<Item = impl Into<SharedString>>, ) -> Self
defaultSelectedKeys — seeds the group’s own selection state.
pub fn on_change( self, f: impl Fn(&[SharedString], &mut Window, &mut App) + 'static, ) -> Self
pub fn child_toggle(self, btn: ToggleButton) -> Self
Trait Implementations§
Source§impl IntoElement for ToggleButtonGroup
impl IntoElement for ToggleButtonGroup
Source§type Element = ViewElement<ToggleButtonGroup>
type Element = ViewElement<ToggleButtonGroup>
The specific type of element into which the implementing type is converted.
Useful for converting other types into elements automatically, like Strings
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Convert self into a type that implements
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
Convert self into a dynamically-typed
AnyElement.Source§impl RenderOnce for ToggleButtonGroup
impl RenderOnce for ToggleButtonGroup
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render this component into an element tree. Note that this method
takes ownership of self, as compared to
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for ToggleButtonGroup
impl !Send for ToggleButtonGroup
impl !Sync for ToggleButtonGroup
impl !UnwindSafe for ToggleButtonGroup
impl Freeze for ToggleButtonGroup
impl Unpin for ToggleButtonGroup
impl UnsafeUnpin for ToggleButtonGroup
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with an animation
Source§fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with a chain of animations
Source§fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>
fn with_spring<T>( self, id: impl Into<ElementId>, animation: SpringAnimation<T>, animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static, ) -> SpringAnimationElement<Self>
Renders this component or element at the value produced by a spring. Read more
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
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> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Imperatively modify self with the given closure.
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
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> ⓘ
Converts
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> ⓘ
Converts
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