Skip to main content

grid_layout_const_var

Macro grid_layout_const_var 

Source
macro_rules! grid_layout_const_var {
    ($name:ident, $base_idx:expr, ($x:expr, $y:expr, $width:expr, $height:expr),
    ($rows:expr, $cols:expr, $gap:expr), [$first:ident, $($rest:ident),+ $(,)?], $layout_fn:ident, $suffix:ident) => { ... };
}
Expand description

Creates constant variables for a grid layout.

This macro generates:

  • A constant for the layout area
  • A constant for the grid layout array
  • Constants for each region in the grid

ยงArguments

  • name - The base name for the generated constants and enum
  • base_idx - The base index to use for region constants
  • (x, y, width, height) - The area for the grid layout
  • (rows, cols, gap) - The grid dimensions and gap
  • [first, rest...] - The region names
  • layout_fn - The layout function to use (column or row)
  • suffix - The suffix to use for the layout array constant