nano-ui
Safe HaskellNone
LanguageGHC2024

NanoUI.Layout.Solve

Description

The layout solver: measures and places the node arena's flow tree, then positions modals, windows and popups.

Synopsis

Documentation

data Measurers Source #

How text and custom widgets are measured. The solve and the placement of floating nodes after it measure with the same, so a label placed in a modal wraps exactly as the solve measured it for the modal's size.

placeWindowNode :: NodeArena -> Measurers -> Float -> Float -> NodeIdx -> Float -> Float -> (Float -> (Float, Float)) -> IO () Source #

Lay out window idx at size w0 h0, clamped to its min and max size and the screen, with its origin, given that size, clamped on screen. Fit sizing caps at intrinsic size; floating windows use an explicit frame size.

scrollBarSlotOf :: NodeArena -> NodeIdx -> IO ScrollBarSlot Source #

Where a scroll container's bar sits, as measurement stored it. Text areas and other nodes read ScrollBarList.

textWrapCap :: Float -> SizingTag -> Float -> Float Source #

The width a text node that is not a row's child wraps at, from its effective max width, width sizing and assigned width: 1e8 or more when nothing caps it (collectNodeTextSpans).