pub enum ComplexTableColumnWidth {
Simple(TableColumnWidth),
Limited(TableColumnWidth, TableColumnWidth, TableColumnWidth),
}Expand description
Table column width with optional minimum and maximum limits.
use druid_widget_nursery::table::{ComplexTableColumnWidth, TableColumnWidth::*};
// flex layout, but with minimum and maximum size
ComplexTableColumnWidth::with_min_max(Flex(1.), Fixed(100.), Fixed(300.));
// flex layout, but use intrinsic size a minimum
ComplexTableColumnWidth::with_min(Flex(1.), Intrinsic);It is usually not necessary to use this type directly, because thert are function to convert from:
- f64 => Simple(Fixed(f64))
Into<TableColumnWidth>=> Simple(TableColumnWidth))(Into<TableColumnWidth>,Range<f64>) => Limited with min/max from range(Into<TableColumnWidth>,Into<TableColumnWidth>) => Limited with minimun(Into<TableColumnWidth>,Into<TableColumnWidth>,Into<TableColumnWidth>) => Limited with min/max
Examples:
use druid_widget_nursery::table::{FlexTable, TableColumnWidth::*};
FlexTable::new()
.with_column_width(64.0)
.with_column_width(Intrinsic)
.with_column_width((Flex(1.0), 60.0))
.with_column_width((Flex(1.0), 60.0..200.0))Variants§
Simple(TableColumnWidth)
Column without limits
Limited(TableColumnWidth, TableColumnWidth, TableColumnWidth)
Limited column (width, min, max)
It is usually better to avoid flex dependent ‘min’ and ‘max’ constraint, because it can lead to unexpected results (with the current resolver).
Implementations§
Source§impl ComplexTableColumnWidth
impl ComplexTableColumnWidth
Sourcepub fn simple(tcw: TableColumnWidth) -> Self
pub fn simple(tcw: TableColumnWidth) -> Self
Create instance without limits
Sourcepub fn with_min_max<W1, W2, W3>(tcw: W1, min: W2, max: W3) -> Self
pub fn with_min_max<W1, W2, W3>(tcw: W1, min: W2, max: W3) -> Self
Create instance with minimum and maximum limit
Trait Implementations§
Source§impl Clone for ComplexTableColumnWidth
impl Clone for ComplexTableColumnWidth
Source§fn clone(&self) -> ComplexTableColumnWidth
fn clone(&self) -> ComplexTableColumnWidth
Returns a duplicate 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 ComplexTableColumnWidth
impl Debug for ComplexTableColumnWidth
Source§impl<W: Into<TableColumnWidth>> From<(W, Range<f64>)> for ComplexTableColumnWidth
impl<W: Into<TableColumnWidth>> From<(W, Range<f64>)> for ComplexTableColumnWidth
Source§impl<W1, W2> From<(W1, W2)> for ComplexTableColumnWidth
impl<W1, W2> From<(W1, W2)> for ComplexTableColumnWidth
Source§impl<W1, W2, W3> From<(W1, W2, W3)> for ComplexTableColumnWidth
impl<W1, W2, W3> From<(W1, W2, W3)> for ComplexTableColumnWidth
Source§fn from(data: (W1, W2, W3)) -> Self
fn from(data: (W1, W2, W3)) -> Self
Converts to this type from the input type.
Source§impl<W: Into<TableColumnWidth>> From<W> for ComplexTableColumnWidth
impl<W: Into<TableColumnWidth>> From<W> for ComplexTableColumnWidth
impl Copy for ComplexTableColumnWidth
Auto Trait Implementations§
impl Freeze for ComplexTableColumnWidth
impl RefUnwindSafe for ComplexTableColumnWidth
impl Send for ComplexTableColumnWidth
impl Sync for ComplexTableColumnWidth
impl Unpin for ComplexTableColumnWidth
impl UnwindSafe for ComplexTableColumnWidth
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.