pub struct GridColumn<C> { /* private fields */ }Expand description
A column of the grid schema.
Implementations§
Source§impl<C: GridColumns> GridColumn<C>
impl<C: GridColumns> GridColumn<C>
Sourcepub fn new(column: C, title: impl Into<SharedString>) -> Self
pub fn new(column: C, title: impl Into<SharedString>) -> Self
A column with a title, 100 px wide.
Sourcepub fn with_width(self, width: Pixels) -> Self
pub fn with_width(self, width: Pixels) -> Self
Sets the initial width, kept within the column’s limits.
Sourcepub fn with_align(self, align: ColumnAlign) -> Self
pub fn with_align(self, align: ColumnAlign) -> Self
Sets the alignment.
Sourcepub fn with_min_width(self, width: Pixels) -> Self
pub fn with_min_width(self, width: Pixels) -> Self
Sets the smallest width; raised to MIN_COLUMN_WIDTH.
Sourcepub fn with_max_width(self, width: Pixels) -> Self
pub fn with_max_width(self, width: Pixels) -> Self
Sets the largest width (default: no limit).
Sourcepub fn with_zone(self, zone: ColumnZone) -> Self
pub fn with_zone(self, zone: ColumnZone) -> Self
Sets the zone (default ColumnZone::Scrolling).
Sourcepub fn with_visible(self, visible: bool) -> Self
pub fn with_visible(self, visible: bool) -> Self
Shows or hides the column initially (default shown).
Sourcepub fn with_resizable(self, resizable: bool) -> Self
pub fn with_resizable(self, resizable: bool) -> Self
Lets the user resize the column with the mouse (default true).
Sourcepub fn with_movable(self, movable: bool) -> Self
pub fn with_movable(self, movable: bool) -> Self
Lets the user drag the column’s header to reorder it (default true).
Sourcepub fn with_sortable(self, sortable: bool) -> Self
pub fn with_sortable(self, sortable: bool) -> Self
Lets a click on the column’s header sort by it (default true).
Sorting through LiveGridState::set_sort is always allowed.
Sourcepub fn with_groupable(self, groupable: bool) -> Self
pub fn with_groupable(self, groupable: bool) -> Self
Lets the user group by the column (default true): drag its header
into the group panel (crate::LiveGrid::group_panel) or use
“Group by this column”. Grouping through
LiveGridState::set_group_by is always allowed.
Sourcepub fn with_content(self, content: CellContent) -> Self
pub fn with_content(self, content: CellContent) -> Self
Sets what the cells paint: the value as text (the default), or an
element of LiveGridDelegate::render_cell.
Sourcepub fn with_icon(self, icon: impl IconNamed) -> Self
pub fn with_icon(self, icon: impl IconNamed) -> Self
Shows icon in the header before the title.
Sourcepub fn with_icon_only(self, icon: impl IconNamed) -> Self
pub fn with_icon_only(self, icon: impl IconNamed) -> Self
Shows only icon in the header. The title stays the column’s name:
its tooltip, its accessible name, and its label in the column
chooser, the menus and an export’s header.
Sourcepub fn with_hideable(self, hideable: bool) -> Self
pub fn with_hideable(self, hideable: bool) -> Self
Sets whether the user may hide the column: “Hide column”,
HideColumn and the column chooser. Default true.
LiveGridState::set_column_visible and a restored layout hide
any column.
Sourcepub fn with_internal(self, internal: bool) -> Self
pub fn with_internal(self, internal: bool) -> Self
Makes the column internal (default false): a helper the grid
sorts, filters, groups and aggregates by, but never shows. It is
hidden whatever with_visible, a restored layout or
LiveGridState::set_column_visible say, and it is not in the column
chooser, “Show all columns”, a copy or an export of the visible
columns. An export that names it (ExportRequest::with_columns)
writes it.
Sourcepub fn with_number_format(self, format: NumberFormat) -> Self
pub fn with_number_format(self, format: NumberFormat) -> Self
Sets how the column shows its numbers (default
NumberFormat::new, two decimals): its cells, its aggregates, a
copy and an export’s text and number hint.
Sourcepub fn with_image_fit(self, fit: ImageFit) -> Self
pub fn with_image_fit(self, fit: ImageFit) -> Self
Sets how an image (CellValue::Image) fits the room of its cell.
Default ImageFit::Contain.
Sourcepub fn with_image_corner_radius(self, radius: Pixels) -> Self
pub fn with_image_corner_radius(self, radius: Pixels) -> Self
Rounds the corners of the images in the cells by radius: half the
image’s height draws a round avatar. Default 0.
Sourcepub fn align(&self) -> ColumnAlign
pub fn align(&self) -> ColumnAlign
The alignment.
Sourcepub fn zone(&self) -> ColumnZone
pub fn zone(&self) -> ColumnZone
The initial zone.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Returns true if the column is shown initially.
Sourcepub fn is_resizable(&self) -> bool
pub fn is_resizable(&self) -> bool
Returns true if the user can resize the column.
Sourcepub fn is_movable(&self) -> bool
pub fn is_movable(&self) -> bool
Returns true if the user can drag the column’s header.
Sourcepub fn is_sortable(&self) -> bool
pub fn is_sortable(&self) -> bool
Returns true if a click on the column’s header sorts by it.
Sourcepub fn is_groupable(&self) -> bool
pub fn is_groupable(&self) -> bool
Returns true if the user can group by the column.
Sourcepub fn content(&self) -> CellContent
pub fn content(&self) -> CellContent
What the cells paint.
Sourcepub fn header_label(&self) -> &HeaderLabel
pub fn header_label(&self) -> &HeaderLabel
What the header shows: the title, an icon and the title, or the icon alone.
Sourcepub fn icon(&self) -> Option<&SharedString>
pub fn icon(&self) -> Option<&SharedString>
The header’s icon (its asset path), if it shows one.
Sourcepub fn is_hideable(&self) -> bool
pub fn is_hideable(&self) -> bool
Returns true if the user may hide the column.
Sourcepub fn number_format(&self) -> NumberFormat
pub fn number_format(&self) -> NumberFormat
How the column shows its numbers.
Sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
Returns true if the column is internal: never shown.
Sourcepub fn image_corner_radius(&self) -> Pixels
pub fn image_corner_radius(&self) -> Pixels
The corner radius of the images in the cells.
Trait Implementations§
Source§impl<C: Clone> Clone for GridColumn<C>
impl<C: Clone> Clone for GridColumn<C>
Source§fn clone(&self) -> GridColumn<C>
fn clone(&self) -> GridColumn<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<C> Freeze for GridColumn<C>where
C: Freeze,
impl<C> RefUnwindSafe for GridColumn<C>where
C: RefUnwindSafe,
impl<C> Send for GridColumn<C>where
C: Send,
impl<C> Sync for GridColumn<C>where
C: Sync,
impl<C> Unpin for GridColumn<C>where
C: Unpin,
impl<C> UnsafeUnpin for GridColumn<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for GridColumn<C>where
C: UnwindSafe,
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