pub struct Column { /* private fields */ }
Expand description
Specifies the properties of a column, like its width range.
Implementations§
Source§impl Column
impl Column
Sourcepub fn auto() -> Self
pub fn auto() -> Self
Automatically sized based on content.
If you have many thousands of rows and are therefore using TableBody::rows
or TableBody::heterogeneous_rows
, then the automatic size will only be based
on the currently visible rows.
Sourcepub fn auto_with_initial_suggestion(suggested_width: f32) -> Self
pub fn auto_with_initial_suggestion(suggested_width: f32) -> Self
Automatically sized.
The given fallback is a loose suggestion, that may be used to wrap cell contents, if they contain a wrapping layout. In most cases though, the given value is ignored.
Sourcepub fn remainder() -> Self
pub fn remainder() -> Self
Take all the space remaining after the other columns have been sized.
If you have multiple Column::remainder
they all
share the remaining space equally.
Sourcepub fn resizable(self, resizable: bool) -> Self
pub fn resizable(self, resizable: bool) -> Self
Can this column be resized by dragging the column separator?
If you don’t call this, the fallback value of
TableBuilder::resizable
is used (which by default is false
).
Sourcepub fn clip(self, clip: bool) -> Self
pub fn clip(self, clip: bool) -> Self
If true
: Allow the column to shrink enough to clip the contents.
If false
: The column will always be wide enough to contain all its content.
Clipping can make sense if you expect a column to contain a lot of things,
and you don’t want it too take up too much space.
If you turn on clipping you should also consider calling Self::at_least
.
Default: false
.
Sourcepub fn at_least(self, minimum: f32) -> Self
pub fn at_least(self, minimum: f32) -> Self
Won’t shrink below this width (in points).
Default: 0.0
Sourcepub fn at_most(self, maximum: f32) -> Self
pub fn at_most(self, maximum: f32) -> Self
Won’t grow above this width (in points).
Default: f32::INFINITY
Sourcepub fn range(self, range: impl Into<Rangef>) -> Self
pub fn range(self, range: impl Into<Rangef>) -> Self
Allowed range of movement (in points), if in a resizable Table
.
Sourcepub fn auto_size_this_frame(self, auto_size_this_frame: bool) -> Self
pub fn auto_size_this_frame(self, auto_size_this_frame: bool) -> Self
If set, the column will be automatically sized based on the content this frame.
Do not set this every frame, just on a specific action.