Skip to main content

TableStyle

Struct TableStyle 

Source
pub struct TableStyle {
    pub header_height: f32,
    pub row_height: f32,
    pub ascending: &'static str,
    pub descending: &'static str,
    pub striped: bool,
    pub resizable: bool,
}
Expand description

The tones and metrics a table draws with.

Metrics only, and the tones come from Palette. That is the division this crate already draws: FieldStyle carries gaps and a marker while the colours stay in the palette, and a table’s colours are the palette’s content, content_muted and action rather than six new ones. makeover-tui splits it the other way round because its palette carries no text tones at all.

Fields§

§header_height: f32

The height of the heading row.

§row_height: f32

The height of a body row.

§ascending: &'static str

The 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. 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 str

Drawn after the heading of a descending column.

§striped: bool

Whether alternate rows take a different background.

egui_extras’ own striping, off by default: the description has no word for it, and a renderer that turned it on would be adding a claim the other two cannot make.

Not every setting egui_extras has becomes a field here. A sticky heading is what TableBuilder::header does and there is no version that does not, so the knob 0.12.0 briefly carried for it offered a choice this renderer cannot make. This one and resizable are the two that pass that test.

§resizable: bool

Whether the user can drag the divider between two columns.

The second knob that is not a metric, and it passes the same test sticky_header failed: egui_extras offers both settings and a renderer can honestly make either choice. Off by default for striped’s reason: the description has no word for it, so a default that turned it on would be this renderer adding a claim the other two cannot make.

It does not fight the narrowing. A drag moves a track for the frames it is held; cutoff_for still decides which columns exist, off the widths the app declared in Sizing, so a resize can never drop a column.

Trait Implementations§

Source§

impl Clone for TableStyle

Source§

fn clone(&self) -> TableStyle

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

impl Copy for TableStyle

Source§

impl Debug for TableStyle

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for TableStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for TableStyle

Source§

fn eq(&self, other: &TableStyle) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TableStyle

Auto Trait Implementations§

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
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

Source§

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

Source§

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

Source§

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

Source§

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.