monomer-1.0.0.1: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Monomer.Widgets.Containers.Stack

Description

Container which stacks its children along a main axis. The layout algorithm considers the different type of size requirements and assigns space according to the logic defined in SizeReq. If the requested fixed space is larger that the viewport of the stack, the content will overflow.

Synopsis

Configuration

data StackCfg Source #

Configuration options for stack:

  • ignoreEmptyArea: when the widgets do not use all the available space, ignoring the unassigned space allows for mouse events to pass through. This is useful in zstack layers.
  • sizeReqUpdater: allows modifying the SizeReq generated by the stack.

Constructors

hstack :: Traversable t => t (WidgetNode s e) -> WidgetNode s e Source #

Creates a horizontal stack.

hstack_ :: Traversable t => [StackCfg] -> t (WidgetNode s e) -> WidgetNode s e Source #

Creates a horizontal stack. Accepts config.

vstack :: Traversable t => t (WidgetNode s e) -> WidgetNode s e Source #

Creates a vertical stack.

vstack_ :: Traversable t => [StackCfg] -> t (WidgetNode s e) -> WidgetNode s e Source #

Creates a vertical stack. Accepts config.

Helpers

assignStackAreas Source #

Arguments

:: Bool

True if horizontal, False for vertical.

-> Rect

The available space to assign.

-> Seq (WidgetNode s e)

The widgets that will be assigned space.

-> (Seq Rect, Double)

The assigned areas and used space in main axis.

Assigns space from rect to each of the provided widgets based on their size requirements.