Struct ListRowFace
pub struct ListRowFace<'a> { /* private fields */ }Expand description
Immediate-mode list row. Build one per row per frame, measure it for
its height, then paint it into the rect you laid out: the row’s outer
rect, the list’s content edge grown by row_bleed on both sides.
Implementations§
§impl<'a> ListRowFace<'a>
impl<'a> ListRowFace<'a>
pub fn new(title: &'a str) -> ListRowFace<'a>
pub fn two_line_title(self) -> ListRowFace<'a>
pub fn two_line_title(self) -> ListRowFace<'a>
Let the title wrap to two lines before it is elided (a long name in a narrow list).
pub fn title_family(self, family: &'a FontChoice) -> ListRowFace<'a>
pub fn title_family(self, family: &'a FontChoice) -> ListRowFace<'a>
Set the title in family: only for a list of fonts, where the title
is its own sample.
pub fn subtitle(self, text: &'a str) -> ListRowFace<'a>
pub fn subtitle(self, text: &'a str) -> ListRowFace<'a>
A Body line between the title and the secondary text (a message’s
subject under its sender).
pub fn secondary(self, text: &'a str) -> ListRowFace<'a>
pub fn secondary(self, text: &'a str) -> ListRowFace<'a>
The secondary line under the title (a preview, an address, a path), elided to one line.
pub fn two_line_secondary(self) -> ListRowFace<'a>
pub fn two_line_secondary(self) -> ListRowFace<'a>
Let the secondary text wrap to two lines before it is elided (a message preview).
pub fn meta(self, text: &'a str) -> ListRowFace<'a>
pub fn meta(self, text: &'a str) -> ListRowFace<'a>
A timestamp, size or count, right-aligned in tabular figures on the title’s line. It narrows only the title’s line.
pub fn meta_spans(self, spans: &'a [(&'a str, Tone)]) -> ListRowFace<'a>
pub fn meta_spans(self, spans: &'a [(&'a str, Tone)]) -> ListRowFace<'a>
A meta made of toned figures (+2.4% in success, −0.8% in danger),
each made legible on the row’s ground and on its lift.
pub fn value(self, text: &'a str) -> ListRowFace<'a>
pub fn value(self, text: &'a str) -> ListRowFace<'a>
A figure at the trailing edge (a time, a code, a temperature) that hover actions never replace.
pub fn title_value(self, text: &'a str) -> ListRowFace<'a>
pub fn title_value(self, text: &'a str) -> ListRowFace<'a>
Self::value as the row’s main figure, in Title.
pub fn mark(self, icon: Icon) -> ListRowFace<'a>
pub fn mark(self, icon: Icon) -> ListRowFace<'a>
A mark after the title in tertiary ink (starred, pinned, shared,
has attachments). Each call adds one more, in order, up to
MAX_MARKS; later ones are ignored. Star, pin and bookmark are
filled.
pub fn swatch_mark(self, color: AlphaColor<Srgb>) -> ListRowFace<'a>
pub fn swatch_mark(self, color: AlphaColor<Srgb>) -> ListRowFace<'a>
A colour the item carries (its project, its calendar), as a small
swatch among the marks after the title. It counts as one of the
MAX_MARKS.
Tags after the title, each a small pill in its style.
pub fn count(self, count: usize) -> ListRowFace<'a>
pub fn count(self, count: usize) -> ListRowFace<'a>
How many items the row stands for (the messages in a thread), in a quiet pill at the trailing edge of the line under the title.
pub fn leading(self, leading: RowLeading<'a>) -> ListRowFace<'a>
pub fn leading_column(self, width: f64) -> ListRowFace<'a>
pub fn leading_column(self, width: f64) -> ListRowFace<'a>
The width every row of this list reserves for its leading column,
from badge_column_width. Any kind of leading content centres in a
column at least this wide.
pub fn status(self, status: RowStatus<'a>) -> ListRowFace<'a>
pub fn disclosure(self) -> ListRowFace<'a>
pub fn disclosure(self) -> ListRowFace<'a>
A trailing chevron: activating the row opens a page.
pub fn checked(self, checked: bool) -> ListRowFace<'a>
pub fn checked(self, checked: bool) -> ListRowFace<'a>
One choice of a single-choice list: a trailing check on the chosen row. Every row of the list reserves the check’s slot.
pub fn emphasized(self, emphasized: bool) -> ListRowFace<'a>
pub fn emphasized(self, emphasized: bool) -> ListRowFace<'a>
Unread or otherwise new: the title takes the strong weight.
pub fn selected(self, selected: bool) -> ListRowFace<'a>
pub fn joined(self, join: RowJoin) -> ListRowFace<'a>
pub fn joined(self, join: RowJoin) -> ListRowFace<'a>
Which neighbours are selected with this row: a run of selected rows is one lift with no notch.
pub fn separator(self, next_selected: bool) -> ListRowFace<'a>
pub fn separator(self, next_selected: bool) -> ListRowFace<'a>
Draw the inset separator along the bottom edge. It hides when this
row or next_selected (the row below) is selected.
pub fn actions(self, actions: &'a [RowAction<'a>]) -> ListRowFace<'a>
pub fn actions(self, actions: &'a [RowAction<'a>]) -> ListRowFace<'a>
Actions shown in place of the meta while the row is hovered or
focused. Hit-test them with Self::action_rects.
pub fn hovered_action(self, index: Option<usize>) -> ListRowFace<'a>
pub fn hovered_action(self, index: Option<usize>) -> ListRowFace<'a>
Which action the pointer (or the keyboard) is on.
pub fn reveal_actions(self, reveal: bool) -> ListRowFace<'a>
pub fn reveal_actions(self, reveal: bool) -> ListRowFace<'a>
Show the actions without hover: a selected row under a touch pointer, which has no hover.
pub fn swiped(self, action: SwipeAction<'a>, offset: f64) -> ListRowFace<'a>
pub fn swiped(self, action: SwipeAction<'a>, offset: f64) -> ListRowFace<'a>
The row slid offset logical pixels toward its leading edge,
revealing action behind its trailing edge.
pub fn trailing_width(self, width: f64) -> ListRowFace<'a>
pub fn trailing_width(self, width: f64) -> ListRowFace<'a>
Reserve width at the trailing edge for one persistent control (a
switch, a button, a small progress ring) the host lays out itself in
Self::trailing_rect. Separators keep their full width.
pub fn interaction(self, interaction: Interaction) -> ListRowFace<'a>
pub fn enabled(self, enabled: bool) -> ListRowFace<'a>
pub fn enabled(self, enabled: bool) -> ListRowFace<'a>
A disabled row: dimmed, no hover, no actions.
pub fn height(&self, text: &mut TextRenderer, theme: &Theme) -> f64
pub fn height(&self, text: &mut TextRenderer, theme: &Theme) -> f64
The row’s height at this text scale.
pub fn action_rects(&self, rect: Rect, theme: &Theme) -> Vec<Rect>
pub fn action_rects(&self, rect: Rect, theme: &Theme) -> Vec<Rect>
Where each hover action sits in rect, in order. Empty unless the
row is hovered, focused or revealing its actions.
pub fn trailing_rect(
&self,
rect: Rect,
text: &mut TextRenderer,
theme: &Theme,
) -> Option<Rect>
pub fn trailing_rect( &self, rect: Rect, text: &mut TextRenderer, theme: &Theme, ) -> Option<Rect>
The slot Self::trailing_width reserved in rect, as tall as the
row; centre the control in it.
pub fn leading_rect(
&self,
rect: Rect,
text: &mut TextRenderer,
theme: &Theme,
) -> Rect
pub fn leading_rect( &self, rect: Rect, text: &mut TextRenderer, theme: &Theme, ) -> Rect
The leading column’s rect in rect: the checkbox’s hit target, or
the badge a tooltip explains.
pub fn title_elided(
&self,
rect: Rect,
text: &mut TextRenderer,
theme: &Theme,
) -> bool
pub fn title_elided( &self, rect: Rect, text: &mut TextRenderer, theme: &Theme, ) -> bool
Whether the title, painted in rect, is cut short with an ellipsis.
A row shows such a title in full in its tooltip.
pub fn accessibility(
&self,
rect: Rect,
action_target: impl Into<String>,
) -> AccessNode
pub fn accessibility( &self, rect: Rect, action_target: impl Into<String>, ) -> AccessNode
The row’s accessibility node: a list item named by its badge and title, with the subtitle, secondary line, meta, value, count, tags and status as its value, and one button child per action.
Trait Implementations§
§impl<'a> Clone for ListRowFace<'a>
impl<'a> Clone for ListRowFace<'a>
§fn clone(&self) -> ListRowFace<'a>
fn clone(&self) -> ListRowFace<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ListRowFace<'a>
impl<'a> !RefUnwindSafe for ListRowFace<'a>
impl<'a> !Send for ListRowFace<'a>
impl<'a> !Sync for ListRowFace<'a>
impl<'a> Unpin for ListRowFace<'a>
impl<'a> UnsafeUnpin for ListRowFace<'a>
impl<'a> !UnwindSafe for ListRowFace<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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