pub struct Grid { /* private fields */ }Expand description
Grid widget: a fixed number of equal-width columns.
Implementations§
Source§impl Grid
impl Grid
Sourcepub fn new(columns: usize) -> Self
pub fn new(columns: usize) -> Self
Create an empty grid with columns columns (0 is stored as 1).
Sourcepub fn gap(self, gap: f32) -> Self
pub fn gap(self, gap: f32) -> Self
Set the gap between cells. A gap that is not finite or is negative is treated as 0.
Sourcepub fn row_height(self, height: f32) -> Self
pub fn row_height(self, height: f32) -> Self
Set a fixed row height. A negative or non-finite height clears it, so the rows share the available height equally.
Sourcepub fn child(self, widget: impl Widget + 'static) -> Self
pub fn child(self, widget: impl Widget + 'static) -> Self
Add a child widget; it takes the next free cell.
Sourcepub fn with_test_id(self, id: impl Into<String>) -> Self
pub fn with_test_id(self, id: impl Into<String>) -> Self
Set test ID.
Sourcepub fn get_columns(&self) -> usize
pub fn get_columns(&self) -> usize
Number of columns.
Sourcepub fn get_gap(&self) -> f32
pub fn get_gap(&self) -> f32
The gap in use (0 when the stored gap is not finite or is negative).
Sourcepub fn get_row_height(&self) -> Option<f32>
pub fn get_row_height(&self) -> Option<f32>
The fixed row height, if one is set.
Trait Implementations§
Source§impl Brick for Grid
impl Brick for Grid
Source§fn brick_name(&self) -> &'static str
fn brick_name(&self) -> &'static str
Get the brick’s unique type name
Source§fn assertions(&self) -> &[BrickAssertion]
fn assertions(&self) -> &[BrickAssertion]
Get all assertions for this brick
Source§fn budget(&self) -> BrickBudget
fn budget(&self) -> BrickBudget
Get the performance budget
Source§fn verify(&self) -> BrickVerification
fn verify(&self) -> BrickVerification
Verify all assertions against current state Read more
Source§fn can_render(&self) -> bool
fn can_render(&self) -> bool
Check if this brick can be rendered (all assertions pass)
Source§impl<'de> Deserialize<'de> for Grid
impl<'de> Deserialize<'de> for Grid
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 Widget for Grid
impl Widget for Grid
Source§fn measure(&self, constraints: Constraints) -> Size
fn measure(&self, constraints: Constraints) -> Size
Compute intrinsic size constraints.
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Position children within allocated bounds.
Source§fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
Get mutable child widgets.
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this widget is interactive (can receive focus/events).
Source§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Check if this widget can receive keyboard focus.
Source§fn accessible_name(&self) -> Option<&str>
fn accessible_name(&self) -> Option<&str>
Get the accessible name for screen readers.
Source§fn accessible_role(&self) -> AccessibleRole
fn accessible_role(&self) -> AccessibleRole
Get the accessible role.
Auto Trait Implementations§
impl !RefUnwindSafe for Grid
impl !UnwindSafe for Grid
impl Forget for Grid
impl Freeze for Grid
impl Move for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnsafeUnpin for Grid
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