pub struct ExpandableListView<State: 'static> { /* private fields */ }Expand description
A declarative M3E expandable list. See the module docs.
Implementations§
Source§impl<State: 'static> ExpandableListView<State>
impl<State: 'static> ExpandableListView<State>
Sourcepub fn expanded(self, indices: impl IntoIterator<Item = usize>) -> Self
pub fn expanded(self, indices: impl IntoIterator<Item = usize>) -> Self
Mark these indices expanded (initiallyExpanded, then every later
app-resolved set). The widget never writes this back.
Sourcepub fn outer_radius(self, radius: f64) -> Self
pub fn outer_radius(self, radius: f64) -> Self
Override the outward corner radius of the first/last (and only) item.
Defaults to EXPANDABLE_OUTER_RADIUS.
Sourcepub fn inner_radius(self, radius: f64) -> Self
pub fn inner_radius(self, radius: f64) -> Self
Override the radius of every adjoining item edge. Defaults to
EXPANDABLE_INNER_RADIUS.
Sourcepub fn hover_radius(self, radius: f64) -> Self
pub fn hover_radius(self, radius: f64) -> Self
Override the inner radius used while an item is hovered. Defaults to
EXPANDABLE_HOVER_RADIUS.
Sourcepub fn pressed_radius(self, radius: f64) -> Self
pub fn pressed_radius(self, radius: f64) -> Self
Override the inner radius used while an item is pressed. Defaults to
EXPANDABLE_PRESSED_RADIUS.
Sourcepub fn expanded_radius(self, radius: f64) -> Self
pub fn expanded_radius(self, radius: f64) -> Self
Round an expanded item uniformly at radius, overriding its position
radii entirely (M3EExpandableStyle.expandedRadius). Unset by default,
as upstream.
Sourcepub fn gap(self, gap: f64) -> Self
pub fn gap(self, gap: f64) -> Self
Override the vertical gap between adjacent items. Defaults to
EXPANDABLE_GAP.
Sourcepub fn color(self, color: Color) -> Self
pub fn color(self, color: Color) -> Self
Replace the item fill (M3EExpandableStyle.color), which otherwise
resolves from colors.surface_container_highest.
Sourcepub fn haptic(self, haptic: HapticSignal) -> Self
pub fn haptic(self, haptic: HapticSignal) -> Self
Set the haptic fired immediately before
on_toggle (M3EExpandableStyle.haptic). Defaults
to HapticSignal::None.
Sourcepub fn on_toggle<F: Fn(&mut State, usize) + 'static>(self, on_toggle: F) -> Self
pub fn on_toggle<F: Fn(&mut State, usize) + 'static>(self, on_toggle: F) -> Self
Fire on_toggle with an item’s index when its header is released
inside itself. Without this the stack is inert chrome: no press state,
no hover claim, and pointer events route straight into the children.
Trait Implementations§
Source§impl<State: 'static> View<State> for ExpandableListView<State>
impl<State: 'static> View<State> for ExpandableListView<State>
Source§type Element = ExpandableListWidget
type Element = ExpandableListWidget
Source§fn build(&self, ctx: &mut BuildCtx<'_>) -> ExpandableListWidget
fn build(&self, ctx: &mut BuildCtx<'_>) -> ExpandableListWidget
Source§fn rebuild(
&self,
prev: &Self,
element: &mut ExpandableListWidget,
ctx: &mut BuildCtx<'_>,
) -> ChangeFlags
fn rebuild( &self, prev: &Self, element: &mut ExpandableListWidget, ctx: &mut BuildCtx<'_>, ) -> ChangeFlags
prev (the previous view of the same type) against the live
element, mutating it in place and reporting what changed.Auto Trait Implementations§
impl<State> !RefUnwindSafe for ExpandableListView<State>
impl<State> !Send for ExpandableListView<State>
impl<State> !Sync for ExpandableListView<State>
impl<State> !UnwindSafe for ExpandableListView<State>
impl<State> Freeze for ExpandableListView<State>
impl<State> Unpin for ExpandableListView<State>
impl<State> UnsafeUnpin for ExpandableListView<State>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.