pub struct TableStyle {
pub header: Style,
pub sorted: Style,
pub sortable: Style,
pub value: Style,
pub tokens: Style,
pub actions: Style,
pub link: Style,
pub selected: Style,
pub column_spacing: u16,
pub ascending: &'static str,
pub descending: &'static str,
}Expand description
The tones and metrics a table draws with.
Apart from [Palette] rather than added to it, and the split is the one
makeover-immediate draws between its palette and its FieldStyle:
[Palette] answers what a surface is, which is what
frame needs, and a table is the first thing in this crate
that draws text. Folding text tones into [Palette] would make every
consumer that only paints a bevel supply six colours it never uses.
from_theme is the answer for anyone with a loaded
theme, and is what a consumer should reach for first.
Fields§
§header: StyleThe heading row.
sorted: StyleThe heading of the column the table is ordered by.
sortable: StyleThe heading of a column that offers to reorder and is not doing it now.
The middle of three tones (wiki three-tone-convention): it answers a
press, so it is neither the emphasised thing nor the inert one. A
heading that took header here would be indistinguishable
from a column that cannot be reordered at all, which is the state this
separates it from.
value: StyleA cell that is text.
tokens: StyleA cell holding badges or chips. They carry their own tone, so this is what sits under one rather than what paints it.
actions: StyleA cell holding controls.
link: StyleA cell whose value is itself a link.
selected: StyleThe row under the cursor, for a caller rendering with a
TableState.
column_spacing: u16Cells between columns. Counted when deciding what fits, so a table that narrows and a table that draws agree about the room available.
ascending: &'static strThe caret drawn after the heading of an ascending column.
Defaults to Sort::glyph, which is where the spelling lives now: three
renderers holding the same literal agreed by coincidence. Still a knob,
because a terminal is the one host that may not be able to draw it — a
font without the geometric-shapes block leaves a box, and "^" is a
better caret than a tofu.
Bare, with no leading space: the gap is [heading]’s, written once for
all three states rather than baked into two strings and forgotten in the
third.
descending: &'static strThe caret drawn after the heading of a descending column.
Implementations§
Trait Implementations§
Source§impl Clone for TableStyle
impl Clone for TableStyle
Source§fn clone(&self) -> TableStyle
fn clone(&self) -> TableStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TableStyle
Source§impl Debug for TableStyle
impl Debug for TableStyle
Source§impl Default for TableStyle
impl Default for TableStyle
impl Eq for TableStyle
Source§impl PartialEq for TableStyle
impl PartialEq for TableStyle
impl StructuralPartialEq for TableStyle
Auto Trait Implementations§
impl Freeze for TableStyle
impl RefUnwindSafe for TableStyle
impl Send for TableStyle
impl Sync for TableStyle
impl Unpin for TableStyle
impl UnsafeUnpin for TableStyle
impl UnwindSafe for TableStyle
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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