pub struct ColumnLayout {
pub padding: usize,
pub spacing: usize,
pub bounds: Rect,
pub gravity: ColumnGravity,
}
Expand description
Position a collection of views into a column This doesn’t act as a container or parent and only moves the views and isn’t needed after it’s been used
Fields§
§padding: usize
§spacing: usize
§bounds: Rect
§gravity: ColumnGravity
Implementations§
Source§impl ColumnLayout
impl ColumnLayout
Sourcepub fn new(
padding: usize,
spacing: usize,
bounds: Rect,
gravity: ColumnGravity,
) -> Self
pub fn new( padding: usize, spacing: usize, bounds: Rect, gravity: ColumnGravity, ) -> Self
§Arguments
padding
- Pixel distance to move all views from the topleft or bottomright (depending on gravity)spacing
- Pixel distance to leave between viewsbounds
- Depends on gravity, if it’s
Gravity | Effects |
---|---|
Left | bounds.top_left() is the starting point, bottom and right are ignored |
Right | bounds.bottom_right() is the starting point, top and left are ignored |
Center | bounds.top_left() is the starting point, views will be positioned between left and right |
gravity
- Effects how views are positioned, see above
pub fn new_from_topleft(topleft: Coord) -> Self
pub fn new_bounded(bounds: Rect) -> Self
Trait Implementations§
Source§impl Clone for ColumnLayout
impl Clone for ColumnLayout
Source§fn clone(&self) -> ColumnLayout
fn clone(&self) -> ColumnLayout
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 ColumnLayout
impl Debug for ColumnLayout
Source§impl<'de> Deserialize<'de> for ColumnLayout
impl<'de> Deserialize<'de> for ColumnLayout
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ColumnLayout
impl PartialEq for ColumnLayout
Source§impl Serialize for ColumnLayout
impl Serialize for ColumnLayout
impl Eq for ColumnLayout
impl StructuralPartialEq for ColumnLayout
Auto Trait Implementations§
impl Freeze for ColumnLayout
impl RefUnwindSafe for ColumnLayout
impl Send for ColumnLayout
impl Sync for ColumnLayout
impl Unpin for ColumnLayout
impl UnwindSafe for ColumnLayout
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.