pub struct LayoutItem {Show 14 fields
pub id: String,
pub x: i32,
pub y: i32,
pub w: i32,
pub h: i32,
pub min_w: Option<i32>,
pub max_w: Option<i32>,
pub min_h: Option<i32>,
pub max_h: Option<i32>,
pub aspect_ratio: Option<f32>,
pub is_static: bool,
pub is_draggable: bool,
pub is_resizable: bool,
pub resize_handles: HashSet<ResizeHandle>,
}Expand description
A single item within the grid layout.
Fields§
§id: StringUnique identifier for the item.
x: i32X coordinate in grid units.
y: i32Y coordinate in grid units.
w: i32Width in grid units.
h: i32Height in grid units.
min_w: Option<i32>Minimum allowed width.
max_w: Option<i32>Maximum allowed width.
min_h: Option<i32>Minimum allowed height.
max_h: Option<i32>Maximum allowed height.
aspect_ratio: Option<f32>Optional fixed aspect ratio width / height in grid units.
is_static: boolIf true, the item cannot be dragged or resized and is fixed for compaction.
is_draggable: boolWhen is_static is false: allow dragging (subject to compaction).
is_resizable: boolWhen is_static is false: allow resizing.
resize_handles: HashSet<ResizeHandle>Enabled resize handles for this item.
Implementations§
Source§impl LayoutItem
impl LayoutItem
Trait Implementations§
Source§impl Clone for LayoutItem
impl Clone for LayoutItem
Source§fn clone(&self) -> LayoutItem
fn clone(&self) -> LayoutItem
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 LayoutItem
impl Debug for LayoutItem
Source§impl Default for LayoutItem
impl Default for LayoutItem
Source§impl<'de> Deserialize<'de> for LayoutItemwhere
LayoutItem: Default,
impl<'de> Deserialize<'de> for LayoutItemwhere
LayoutItem: Default,
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 LayoutItem
impl PartialEq for LayoutItem
Source§impl Serialize for LayoutItem
impl Serialize for LayoutItem
impl StructuralPartialEq for LayoutItem
Auto Trait Implementations§
impl Freeze for LayoutItem
impl RefUnwindSafe for LayoutItem
impl Send for LayoutItem
impl Sync for LayoutItem
impl Unpin for LayoutItem
impl UnsafeUnpin for LayoutItem
impl UnwindSafe for LayoutItem
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