pub struct RowLayout {
pub padding: usize,
pub spacing: usize,
pub bounds: Rect,
pub gravity: RowGravity,
}
Expand description
Position a collection of views into a row 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: RowGravity
Implementations§
Source§impl RowLayout
impl RowLayout
Sourcepub fn new(
padding: usize,
spacing: usize,
bounds: Rect,
gravity: RowGravity,
) -> Self
pub fn new( padding: usize, spacing: usize, bounds: Rect, gravity: RowGravity, ) -> 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 |
---|---|
Top | bounds.top_left() is the starting point, bottom and right are ignored |
Bottom | 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 top and bottom |
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<'de> Deserialize<'de> for RowLayout
impl<'de> Deserialize<'de> for RowLayout
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
impl Eq for RowLayout
impl StructuralPartialEq for RowLayout
Auto Trait Implementations§
impl Freeze for RowLayout
impl RefUnwindSafe for RowLayout
impl Send for RowLayout
impl Sync for RowLayout
impl Unpin for RowLayout
impl UnwindSafe for RowLayout
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<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.