pub struct ColumnSpec {
pub label: String,
pub width: i32,
pub min_width: i32,
pub align: Align,
pub hidden: bool,
pub flex: u16,
pub resizable: bool,
pub movable: bool,
pub fixed: bool,
pub editable: bool,
pub validator: Option<ValidatorFactory>,
}Expand description
One column of a Table.
Fields§
§label: StringThe header label.
width: i32Preferred width in cells.
min_width: i32The narrowest the layout may shrink this column to (at least 1).
align: AlignAlignment of the label and the cells.
A hidden column takes no space at all (no cell, no separator).
flex: u16Stretch weight (0 = fixed, the default). When the visible columns are narrower than the table, the spare cells go to the flex columns in proportion to their weights.
resizable: boolThe user may change the width by dragging the separator right of the
label (default true).
movable: boolThe user may move the column by dragging its label (default true).
fixed: boolThe layout never shrinks this column below width: it overflows and
scrolls instead. A user resize sets it (and clears flex), so a
dragged width holds.
editable: boolThe user may edit the cells (default false): the cell cursor visits
the column and F2 or a double-click opens an editor on it.
validator: Option<ValidatorFactory>Builds a fresh Validator for every cell editor opened on this
column (none by default).
Implementations§
Source§impl ColumnSpec
impl ColumnSpec
Sourcepub fn new(label: impl Into<String>, width: i32) -> Self
pub fn new(label: impl Into<String>, width: i32) -> Self
A left-aligned, visible column of preferred width, shrinkable to 1.
Sourcepub fn min_width(self, min_width: i32) -> Self
pub fn min_width(self, min_width: i32) -> Self
Builder: the narrowest this column may be shrunk to.
Builder: start hidden.
Sourcepub fn flex(self, weight: u16) -> Self
pub fn flex(self, weight: u16) -> Self
Builder: let this column stretch into spare width with weight
(0 = fixed). width is the width it starts from; a flex column is at
least min_width wide, so ColumnSpec::new("Notes", 0).flex(1) simply
fills the rest.
Sourcepub fn resizable(self, resizable: bool) -> Self
pub fn resizable(self, resizable: bool) -> Self
Builder: whether the user may drag the column’s width (default
true).
Sourcepub fn movable(self, movable: bool) -> Self
pub fn movable(self, movable: bool) -> Self
Builder: whether the user may drag the column to another position
(default true).
Sourcepub fn fixed(self, fixed: bool) -> Self
pub fn fixed(self, fixed: bool) -> Self
Builder: keep the column at width instead of shrinking it to fit
(default false; see fixed).
Trait Implementations§
Source§impl Clone for ColumnSpec
impl Clone for ColumnSpec
Source§fn clone(&self) -> ColumnSpec
fn clone(&self) -> ColumnSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ColumnSpec
impl Debug for ColumnSpec
impl Eq for ColumnSpec
Source§impl PartialEq for ColumnSpec
impl PartialEq for ColumnSpec
impl StructuralPartialEq for ColumnSpec
Auto Trait Implementations§
impl !RefUnwindSafe for ColumnSpec
impl !Send for ColumnSpec
impl !Sync for ColumnSpec
impl !UnwindSafe for ColumnSpec
impl Freeze for ColumnSpec
impl Unpin for ColumnSpec
impl UnsafeUnpin for ColumnSpec
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.