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 item(self, item: Option<&'a str>) -> ListRowFace<'a>
pub fn item(self, item: Option<&'a str>) -> ListRowFace<'a>
Say which item of its collection the row shows
(AccessNode::item).
pub fn new(title: &'a str) -> ListRowFace<'a>
pub fn card(self) -> ListRowFace<'a>
pub fn card(self) -> ListRowFace<'a>
The row as a card: a surface of its own, its title wrapped over up to
CARD_TITLE_LINES lines with the facts on a line under the text, in the order they
read in a row.
pub fn dense(self) -> ListRowFace<'a>
pub fn dense(self) -> ListRowFace<'a>
The row as a dense row: one line at the caption’s size, the small glyph, as tall as that line and its inset: a quiet reference under content, or a list that shows a lot at once.
pub fn row_height(self, px: f32) -> ListRowFace<'a>
pub fn row_height(self, px: f32) -> ListRowFace<'a>
Stand the row px tall, rather than the list’s row height for what it holds: a tree’s
own row token, shorter than a list’s. What the row holds still fits inside it.
pub fn title_lines(self, lines: u8) -> ListRowFace<'a>
pub fn title_lines(self, lines: u8) -> ListRowFace<'a>
How many lines the title may take: Self::two_line_title sets two, a card sets what
its title wraps to.
pub fn check_pose(self, pose: CheckPose) -> ListRowFace<'a>
pub fn check_pose(self, pose: CheckPose) -> ListRowFace<'a>
Draw the leading checkbox where its motion is this frame rather than at rest on its
value (crate::widget::checkbox::CheckMotion::pose).
pub fn found(self, words: &'a [&'a str]) -> ListRowFace<'a>
pub fn found(self, words: &'a [&'a str]) -> ListRowFace<'a>
Mark words, what a search found the row by, where the title has
them: each at the start of a word, whatever its case, under the find
bar’s match wash (paint_find_match).
pub fn prefix(self, word: &'a str) -> ListRowFace<'a>
pub fn prefix(self, word: &'a str) -> ListRowFace<'a>
A quiet word before the title, on its line and in the weaker ink: where the item came from. The title takes the room left after it.
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 note(self, text: &'a str) -> ListRowFace<'a>
pub fn note(self, text: &'a str) -> ListRowFace<'a>
A line under the text of the row’s own: what waits on the item, which the app says and the row only carries.
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 secondary_lines(self, lines: u8) -> ListRowFace<'a>
pub fn secondary_lines(self, lines: u8) -> ListRowFace<'a>
Let the secondary text take up to lines lines (one to four): a
thing whose facts each stand on a line of their own.
pub fn meta(self, text: &'a str) -> ListRowFace<'a>
pub fn meta(self, text: &'a str) -> ListRowFace<'a>
When it happened or is due (a day, with the time of day it is due where the view pairs one), in tabular figures: the first fact of the facts column, on 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 among the facts (how far a branch got, a temperature), between who it is and how important it is.
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 avatar(self, avatar: AvatarFace<'a>) -> ListRowFace<'a>
pub fn avatar(self, avatar: AvatarFace<'a>) -> ListRowFace<'a>
Who the item is, as a fact in the facts column: their face, between when it is due and
how far it has got. A row led by an avatar (RowLeading::Avatar) is a row that is
the person (a contact); a row that is something a person is on shows them here.
pub fn mark(self, icon: Icon) -> ListRowFace<'a>
pub fn mark(self, icon: Icon) -> ListRowFace<'a>
A mark on the row’s edge, after every other fact (starred, pinned, shared, how much it
matters), in tertiary ink or the row’s own tone. Each call adds one more, in order, up
to MAX_MARKS; later ones are ignored. Star, pin and bookmark are filled.
pub fn mark_tone(self, tone: Tone) -> ListRowFace<'a>
pub fn mark_tone(self, tone: Tone) -> ListRowFace<'a>
The tone the row’s mark reads in (an item’s priority): a theme role, never a colour.
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, a branch’s open steps), in a quiet pill among the facts, after the figure.
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 nested(self, nested: bool) -> ListRowFace<'a>
pub fn nested(self, nested: bool) -> ListRowFace<'a>
Indent the row one leading column, under the row above it: an option that belongs to the one above and shows only while it applies.
pub fn depth(self, depth: u32) -> ListRowFace<'a>
pub fn depth(self, depth: u32) -> ListRowFace<'a>
Indent the row’s content depth steps in, one disclosure gutter each, as a
subtree’s rows stand under their parents.
pub fn tree_row(self, tree_row: bool) -> ListRowFace<'a>
pub fn tree_row(self, tree_row: bool) -> ListRowFace<'a>
Stand the row in a tree, one disclosure gutter in from its depth’s column: the list hangs the chevron that folds it there, and a row with nothing to fold keeps that gutter free so that the rows at one depth stand on one column.
pub fn change(self, change: RowChange<'a>) -> ListRowFace<'a>
pub fn struck(self, struck: bool) -> ListRowFace<'a>
pub fn struck(self, struck: bool) -> ListRowFace<'a>
The row stands for an item that was removed: its title struck through, in the weaker ink, at the row’s own height.
pub fn quiet(self, quiet: bool) -> ListRowFace<'a>
pub fn quiet(self, quiet: bool) -> ListRowFace<'a>
The row reads as subordinate to the rows around it: its title in the weaker ink, as an outline’s quieter branch does.
pub fn change_rect(
&self,
rect: Rect,
text: &mut TextRenderer,
theme: &Theme,
) -> Option<Rect>
pub fn change_rect( &self, rect: Rect, text: &mut TextRenderer, theme: &Theme, ) -> Option<Rect>
Where the face of an unseen change sits in rect, when the row shows one.
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 disclosure_turned(self, turn: f64) -> ListRowFace<'a>
pub fn disclosure_turned(self, turn: f64) -> ListRowFace<'a>
A trailing chevron for a row that opens in place, turned turn of
the way (0 closed, 1 open) from pointing at the row’s end to
pointing down — crate::motion::Disclose’s turn.
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 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.
§impl ListRowFace<'_>
impl ListRowFace<'_>
pub fn shape(&self) -> RowShape
pub fn shape(&self) -> RowShape
The kind of row this face paints: its geometry, apart from what it says.
pub fn paint_skeleton(
&self,
ctx: &mut PaintCtx<'_>,
rect: Rect,
caption: Option<&str>,
)
pub fn paint_skeleton( &self, ctx: &mut PaintCtx<'_>, rect: Rect, caption: Option<&str>, )
Paint this row’s skeleton in rect: its leading mark and a bar
where each of its lines stands, as Self::paint places them.
caption (where the row comes from) takes the last line’s place,
so naming the source moves nothing.
§impl ListRowFace<'_>
impl ListRowFace<'_>
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.
§impl ListRowFace<'_>
impl ListRowFace<'_>
pub fn paint(&self, ctx: &mut PaintCtx<'_>, rect: Rect)
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.
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> 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>, which can then be
downcast into Box<dyn 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>, which 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