pub struct TableColumn { /* private fields */ }Expand description
Header label, width policy, and default cell alignment for one column.
Labels are stored unchanged. The default is auto width and start alignment.
§Examples
use ailloli_ui_widgets::controls::{TableAlign, TableColumn};
let column = TableColumn::new("Name").width(160.0).align(TableAlign::Start);
let _ = column;Implementations§
Source§impl TableColumn
impl TableColumn
Sourcepub fn new(label: impl Into<String>) -> Self
pub fn new(label: impl Into<String>) -> Self
Creates an auto-width, start-aligned column.
§Examples
use ailloli_ui_widgets::controls::TableColumn;
let column = TableColumn::new("Status");
let _ = column;Sourcepub fn width(self, width: f32) -> Self
pub fn width(self, width: f32) -> Self
Sets fixed width after f32::max(width, 0.0) normalization.
The table style’s minimum column width is still applied during layout.
§Examples
use ailloli_ui_widgets::controls::TableColumn;
let column = TableColumn::new("Name").width(160.0);
let _ = column;Sourcepub fn column_width(self, width: TableColumnWidth) -> Self
pub fn column_width(self, width: TableColumnWidth) -> Self
Sets an exact width policy without builder-time normalization.
Fixed widths and flex weights are normalized during layout.
§Examples
use ailloli_ui_widgets::controls::{TableColumn, TableColumnWidth};
let column = TableColumn::new("Name").column_width(TableColumnWidth::Auto);
let _ = column;Sourcepub fn flex(self, weight: f32) -> Self
pub fn flex(self, weight: f32) -> Self
Sets flex width with weight normalized by f32::max(weight, 0.0).
Zero-weight flex columns receive only the style minimum.
§Examples
use ailloli_ui_widgets::controls::TableColumn;
let column = TableColumn::new("Description").flex(2.0);
let _ = column;Sourcepub fn auto(self) -> Self
pub fn auto(self) -> Self
Restores content-measured auto width.
§Examples
use ailloli_ui_widgets::controls::TableColumn;
let column = TableColumn::new("Name").width(100.0).auto();
let _ = column;Sourcepub fn align(self, align: TableAlign) -> Self
pub fn align(self, align: TableAlign) -> Self
Sets header alignment and fallback alignment for cells in this column.
§Examples
use ailloli_ui_widgets::controls::{TableAlign, TableColumn};
let column = TableColumn::new("Total").align(TableAlign::End);
let _ = column;Trait Implementations§
Source§impl Clone for TableColumn
impl Clone for TableColumn
Source§fn clone(&self) -> TableColumn
fn clone(&self) -> TableColumn
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TableColumn
impl Debug for TableColumn
Source§impl PartialEq for TableColumn
impl PartialEq for TableColumn
impl StructuralPartialEq for TableColumn
Auto Trait Implementations§
impl Freeze for TableColumn
impl RefUnwindSafe for TableColumn
impl Send for TableColumn
impl Sync for TableColumn
impl Unpin for TableColumn
impl UnwindSafe for TableColumn
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.