FULE-0.3.1: Functional UI Layout Engine
Copyright(c) Paul Schnapp 2023
LicenseBSD3
MaintainerPaul Schnapp <paul.schnapp@gmail.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

FULE.Container.Grid

Description

A two-dimensional grid of items, evenly spaced.

You may also wish to consider the Arrayed Container.

Synopsis

Documentation

data GridM m k Source #

A two-dimensional grid of visual ItemMs, evenly spaced.

Instances

Instances details
Monad m => Container (GridM m k) k m Source # 
Instance details

Defined in FULE.Container.Grid

Methods

minWidth :: GridM m k -> Proxy k -> m (Maybe Int) Source #

minHeight :: GridM m k -> Proxy k -> m (Maybe Int) Source #

addToLayout :: GridM m k -> Proxy k -> Bounds -> RenderGroup -> LayoutOp k m () Source #

type Grid = GridM Identity Source #

Like GridM but run in the Identity monad.

grid Source #

Arguments

:: (Int, Int)

The number of rows and columns the GridM should have.

-> [ItemM m k]

The ItemMs to put in the GridM.

Placement of the ItemMs will start with the top-left position of the grid and proceed to the right, wrapping around to the next row when the end of the previous row has been reached.

If the number of elements in this list does not meet or exceeds the number of grid locations available, then up-to the number of grid locations will be filled, but no more than that.

-> GridM m k 

Create a GridM of ItemMs.