pub struct ChoiceTile { /* private fields */ }Expand description
One choice in a connected group of tiles: tonal selection on the secondary container, a leading icon, the label with optional supporting text, a trailing status chip and a radio. An unavailable choice keeps its status chip at full strength.
It is exposed as a radio button. Put the choices of one question in a
ChoiceGroup, which adds the radio group, roving focus and arrow
keys.
Implementations§
Source§impl ChoiceTile
impl ChoiceTile
Sourcepub fn new(
id: impl Into<ElementId>,
index: usize,
count: usize,
title: impl Into<SharedString>,
selected: bool,
) -> Self
pub fn new( id: impl Into<ElementId>, index: usize, count: usize, title: impl Into<SharedString>, selected: bool, ) -> Self
The choice at index of a vertical group of count.
Sourcepub fn corners(self, outer: OuterCorners) -> Self
pub fn corners(self, outer: OuterCorners) -> Self
Which corners are outside the group, when the tile is not simply one of a vertical list (e.g. choices hanging below another tile).
pub fn icon(self, icon: impl IntoElement) -> Self
Sourcepub fn tinted_icon(self, icon: Icon, tint: Tint, size: Pixels) -> Self
pub fn tinted_icon(self, icon: Icon, tint: Tint, size: Pixels) -> Self
A category icon in its tinted circle. While the tile is selected the circle turns to the surface, so it stays distinct from the secondary container behind it.
pub fn description(self, description: impl Into<SharedString>) -> Self
pub fn status(self, status: Option<impl IntoElement>) -> Self
Sourcepub fn preview_state(self, state: InteractionPreview) -> Self
pub fn preview_state(self, state: InteractionPreview) -> Self
Render a static specimen in one forced interaction state, painting
what the live state paints. See InteractionPreview.
pub fn enabled(self, enabled: bool) -> Self
Sourcepub fn render(self, window: &mut Window, cx: &mut App) -> RingedButton
pub fn render(self, window: &mut Window, cx: &mut App) -> RingedButton
Resolve the tile for this frame. A plain method rather than
RenderOnce, so callers can still chain on_click and styles on
the returned button. Outside a ChoiceGroup the tile has no
arrow-key navigation.
Auto Trait Implementations§
impl !RefUnwindSafe for ChoiceTile
impl !Send for ChoiceTile
impl !Sync for ChoiceTile
impl !UnwindSafe for ChoiceTile
impl Freeze for ChoiceTile
impl Unpin for ChoiceTile
impl UnsafeUnpin for ChoiceTile
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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