Struct DataTableFace
pub struct DataTableFace<'a> { /* private fields */ }Expand description
An immediate-mode table for a painted host (a track list): the
DataTable’s header, columns, row heights, zebra and lift, painted per
frame. paint takes the table’s content rect; the lift and the stripe
bleed past it by crate::chrome::row_bleed as the retained table’s do.
The host hit-tests with Self::row_at and scrolls by passing the rows
it shows.
Implementations§
§impl<'a> DataTableFace<'a>
impl<'a> DataTableFace<'a>
pub fn new( columns: &'a [FaceColumn<'a>], rows: &'a [&'a [&'a str]], ) -> DataTableFace<'a>
pub fn first_row(self, index: usize) -> DataTableFace<'a>
pub fn first_row(self, index: usize) -> DataTableFace<'a>
The display index of the first row given.
pub fn selected(self, row: Option<usize>) -> DataTableFace<'a>
pub fn selected(self, row: Option<usize>) -> DataTableFace<'a>
The selected row, by index into the rows given.
pub fn hovered(self, row: Option<usize>) -> DataTableFace<'a>
pub fn hovered(self, row: Option<usize>) -> DataTableFace<'a>
The row under the pointer.
pub fn sorted_by(self, column: usize, ascending: bool) -> DataTableFace<'a>
pub fn sorted_by(self, column: usize, ascending: bool) -> DataTableFace<'a>
The sorted column and its direction.
pub fn compact(self) -> DataTableFace<'a>
pub fn compact(self) -> DataTableFace<'a>
Rows a small control tall.
pub fn two_line(self) -> DataTableFace<'a>
pub fn two_line(self) -> DataTableFace<'a>
Rows tall enough for a cell the host paints as a Body line over a
Caption one (a song over its artist, a file over its folder).
pub fn without_header(self) -> DataTableFace<'a>
pub fn without_header(self) -> DataTableFace<'a>
A table without its header band (a continuation of a list whose columns need no names): rows start at the top of the rect.
pub fn header_height(theme: &Theme) -> f64
pub fn header_height(theme: &Theme) -> f64
The header band’s height.
pub fn row_height(&self, theme: &Theme) -> f64
pub fn row_height(&self, theme: &Theme) -> f64
One row’s height.
pub fn column_rects(
&self,
rect: Rect,
text: &mut TextRenderer,
theme: &Theme,
) -> Vec<Rect>
pub fn column_rects( &self, rect: Rect, text: &mut TextRenderer, theme: &Theme, ) -> Vec<Rect>
Each column’s rect in rect, at the header’s height: the band runs
the bleed past the content edges, Auto columns measured from their
header and cells.
pub fn row_rect(&self, rect: Rect, index: usize, theme: &Theme) -> Rect
pub fn row_rect(&self, rect: Rect, index: usize, theme: &Theme) -> Rect
Row index’s lift rect in a table painted into rect.
Trait Implementations§
§impl<'a> Clone for DataTableFace<'a>
impl<'a> Clone for DataTableFace<'a>
§fn clone(&self) -> DataTableFace<'a>
fn clone(&self) -> DataTableFace<'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 DataTableFace<'a>
impl<'a> RefUnwindSafe for DataTableFace<'a>
impl<'a> Send for DataTableFace<'a>
impl<'a> Sync for DataTableFace<'a>
impl<'a> Unpin for DataTableFace<'a>
impl<'a> UnsafeUnpin for DataTableFace<'a>
impl<'a> UnwindSafe for DataTableFace<'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> DowncastSync for T
impl<T> DowncastSync for T
§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