License | BSD-3-Clause |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Swarm.TUI.Border
Description
Special border drawing functions that can include labels in more places than just the top center.
Synopsis
- data HBorderLabels n
- plainHBorder :: HBorderLabels n
- leftLabel :: forall n. Lens' (HBorderLabels n) (Maybe (Widget n))
- centerLabel :: forall n. Lens' (HBorderLabels n) (Maybe (Widget n))
- rightLabel :: forall n. Lens' (HBorderLabels n) (Maybe (Widget n))
- data BorderLabels n
- plainBorder :: BorderLabels n
- topLabels :: forall n. Lens' (BorderLabels n) (HBorderLabels n)
- bottomLabels :: forall n. Lens' (BorderLabels n) (HBorderLabels n)
- hBorderWithLabels :: HBorderLabels n -> Widget n
- borderWithLabels :: BorderLabels n -> Widget n -> Widget n
Horizontal border labels
data HBorderLabels n Source #
Labels for a horizontal border, with optional left, middle, and right labels.
plainHBorder :: HBorderLabels n Source #
A plain horizontal border with no labels.
centerLabel :: forall n. Lens' (HBorderLabels n) (Maybe (Widget n)) Source #
rightLabel :: forall n. Lens' (HBorderLabels n) (Maybe (Widget n)) Source #
Rectangular border labels
data BorderLabels n Source #
Labels for a rectangular border, with optional left, middle, and right labels on the top and bottom.
plainBorder :: BorderLabels n Source #
A plain rectangular border with no labels.
topLabels :: forall n. Lens' (BorderLabels n) (HBorderLabels n) Source #
bottomLabels :: forall n. Lens' (BorderLabels n) (HBorderLabels n) Source #
Border-drawing functions
hBorderWithLabels :: HBorderLabels n -> Widget n Source #
Draw a horizontal border with three optional labels. The left label (if present) will be placed two units away from the left end of the border, and the right label will be placed two units away from the right end. The center label, if present, will always be centered in the border overall, regardless of the width of the left and right labels. This ensures that when the labels change width, they do not cause the other labels to wiggle.
borderWithLabels :: BorderLabels n -> Widget n -> Widget n Source #
Put a rectangular border around the specified widget with the specified label widgets placed around the border.