cattrap-0.6.0.0: Lays out boxes according to the CSS Box Model.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.Layout.Flex

Description

Layout formula positioning children horizontally or vertically, with or without wrapping.

Synopsis

Documentation

data Flex a b Source #

Parameters to flexbox layout

Constructors

Flex 

Fields

Instances

Instances details
(Read b, Read a) => Read (Flex a b) Source # 
Instance details

Defined in Graphics.Layout.Flex

Methods

readsPrec :: Int -> ReadS (Flex a b) #

readList :: ReadS [Flex a b] #

readPrec :: ReadPrec (Flex a b) #

readListPrec :: ReadPrec [Flex a b] #

(Show b, Show a) => Show (Flex a b) Source # 
Instance details

Defined in Graphics.Layout.Flex

Methods

showsPrec :: Int -> Flex a b -> ShowS #

show :: Flex a b -> String #

showList :: [Flex a b] -> ShowS #

(Eq b, Eq a) => Eq (Flex a b) Source # 
Instance details

Defined in Graphics.Layout.Flex

Methods

(==) :: Flex a b -> Flex a b -> Bool #

(/=) :: Flex a b -> Flex a b -> Bool #

data FlexChild a b Source #

Properties for positioning a child of a flexbox

Constructors

FlexChild 

Fields

Instances

Instances details
(Read b, Read a) => Read (FlexChild a b) Source # 
Instance details

Defined in Graphics.Layout.Flex

(Show b, Show a) => Show (FlexChild a b) Source # 
Instance details

Defined in Graphics.Layout.Flex

Methods

showsPrec :: Int -> FlexChild a b -> ShowS #

show :: FlexChild a b -> String #

showList :: [FlexChild a b] -> ShowS #

(Eq b, Eq a) => Eq (FlexChild a b) Source # 
Instance details

Defined in Graphics.Layout.Flex

Methods

(==) :: FlexChild a b -> FlexChild a b -> Bool #

(/=) :: FlexChild a b -> FlexChild a b -> Bool #

data Direction Source #

Which axis to position children along

Constructors

Row 
Column 

Instances

Instances details
Read Direction Source # 
Instance details

Defined in Graphics.Layout.Flex

Show Direction Source # 
Instance details

Defined in Graphics.Layout.Flex

Eq Direction Source # 
Instance details

Defined in Graphics.Layout.Flex

data FlexWrapping Source #

Whether to wrap or reverse the wrapped lines

Constructors

NoWrap 
Wrap 
WrapReverse 

data Justification Source #

How to position lines within a flexbox, or children within a line

data Alignment Source #

How to align children along the cross-axis (opposite axis from which they're laid out)

Instances

Instances details
Read Alignment Source # 
Instance details

Defined in Graphics.Layout.Flex

Show Alignment Source # 
Instance details

Defined in Graphics.Layout.Flex

Eq Alignment Source # 
Instance details

Defined in Graphics.Layout.Flex

flexMap :: (a -> b) -> Flex a c -> Flex b c Source #

Apply an operation to every child

flexResolve :: CastDouble b => (a -> Direction -> Double) -> Double -> Flex a b -> Flex a Double Source #

Resolve lengths in the flexbox to doubles.

flexMaxBasis :: Flex a Double -> Double Source #

The minimum size of the flexbox along direction, i.e. maximum size of a child.

flexSumBasis :: Flex a Double -> Double Source #

The maximum width of each row of the flexbox.

flexWrap :: CastDouble b => Flex a b -> Double -> Flex a b Source #

Wrap all lines to a given size reassigning overflow or underflow space. NOTE: shrink propery may yield negative sizes. Caller will want to enforce min-sizes.

flexRowSize :: (a -> Double) -> [FlexChild a b] -> Double Source #

The cross (opposite from direction axis) size of a row.

flexRowsSize :: (a -> Double) -> Flex a Double -> Double Source #

The cross (opposite from direction axis) size of all rows.

justifyOffset :: Double -> [Double] -> Double -> Justification -> Double Source #

How far right to shift some elements to achieve desired justification.

justifySpacing :: Double -> [Double] -> Double -> Justification -> Double Source #

How much space to add between elements.

flexJustify :: (a -> Double) -> Double -> [a] -> Double -> Justification -> [(Double, a)] Source #

Position new positions for the given items according to the given justification.

alignOffset :: Double -> Double -> Alignment -> Double Source #

How far right to shift some elements to achieve desired alignment.

outerMain :: Num m => PaddedBox m m -> Direction -> m Source #

innerMain :: Num m => PaddedBox m m -> Direction -> m Source #

flexGetBox :: (Zero m, CastDouble m, Zero n, CastDouble n) => (a -> PaddedBox Double Double) -> Flex a m -> PaddedBox m n Source #

Compute the size bounds of a flexbox.

flexSplit :: (a -> Size Double Double) -> Double -> Double -> Flex a Double -> (Flex a Double, Flex a Double) Source #

Split a flexbox over multiple pages.

flexPosition :: ((Double, Double) -> a -> b) -> (a -> Size Double Double) -> (Double, Double) -> Size Double Double -> Flex a Double -> Flex b Double Source #

Compute final position of a flexbox's children.