Skip to main content

ListRowFace

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

Let the secondary text wrap to two lines before it is elided (a message preview).

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>

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>

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>

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>

Self::value as the row’s main figure, in Title.

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>

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>

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>

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.

pub fn tags(self, tags: &'a [(&'a str, ChipStyle)]) -> ListRowFace<'a>

Tags after the title, each a small pill in its style.

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>

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>

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>

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>

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>

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>

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>

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>

A trailing chevron: activating the row opens a page.

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>

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>

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>

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>

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>

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>

Which action the pointer (or the keyboard) is on.

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>

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>

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>

A disabled row: dimmed, no hover, no actions.

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<'_>

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>, )

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<'_>

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>

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>

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

The leading column’s rect in rect: the checkbox’s hit target, or the badge a tooltip explains.

§

impl ListRowFace<'_>

pub fn paint(&self, ctx: &mut PaintCtx<'_>, rect: Rect)

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>

§

fn clone(&self) -> ListRowFace<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'a> Debug for ListRowFace<'a>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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 T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,