Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Helper functions for style types.
Synopsis
- getContentArea :: WidgetNode s e -> StyleState -> Rect
- nodeKey :: WidgetNode s e -> Text -> WidgetNode s e
- nodeEnabled :: WidgetNode s e -> Bool -> WidgetNode s e
- nodeVisible :: WidgetNode s e -> Bool -> WidgetNode s e
- nodeFocusable :: WidgetNode s e -> Bool -> WidgetNode s e
- styleFont :: StyleState -> Font
- styleFontSize :: StyleState -> FontSize
- styleFontSpaceH :: StyleState -> FontSpace
- styleFontSpaceV :: StyleState -> FontSpace
- styleFontColor :: StyleState -> Color
- styleTextAlignH :: StyleState -> AlignTH
- styleTextAlignV :: StyleState -> AlignTV
- styleTextLineBreak :: StyleState -> LineBreak
- styleBgColor :: StyleState -> Color
- styleFgColor :: StyleState -> Color
- styleSndColor :: StyleState -> Color
- styleHlColor :: StyleState -> Color
- getOuterSize :: StyleState -> Size
- addOuterSize :: StyleState -> Size -> Maybe Size
- addOuterBounds :: StyleState -> Rect -> Maybe Rect
- removeOuterSize :: StyleState -> Size -> Maybe Size
- removeOuterBounds :: StyleState -> Rect -> Maybe Rect
- addBorder :: Rect -> Maybe Border -> Maybe Rect
- addPadding :: Rect -> Maybe Padding -> Maybe Rect
- subtractBorder :: Rect -> Maybe Border -> Maybe Rect
- subtractPadding :: Rect -> Maybe Padding -> Maybe Rect
- subtractBorderFromRadius :: Maybe Border -> Radius -> Radius
- mapStyleStates :: (StyleState -> StyleState) -> Style -> Style
Documentation
getContentArea :: WidgetNode s e -> StyleState -> Rect Source #
Returns the content area (i.e., ignoring border and padding) of the node.
nodeKey :: WidgetNode s e -> Text -> WidgetNode s e infixl 5 Source #
Sets the key of the given node.
nodeEnabled :: WidgetNode s e -> Bool -> WidgetNode s e infixl 5 Source #
Sets whether the given node is enabled.
nodeVisible :: WidgetNode s e -> Bool -> WidgetNode s e infixl 5 Source #
Sets whether the given node is visible.
nodeFocusable :: WidgetNode s e -> Bool -> WidgetNode s e infixl 5 Source #
Sets whether the given node is focusable.
styleFont :: StyleState -> Font Source #
Returns the font of the given style state, or the default.
styleFontSize :: StyleState -> FontSize Source #
Returns the font size of the given style state, or the default.
styleFontSpaceH :: StyleState -> FontSpace Source #
Returns the horizontal spacing of the given style state, or the default.
styleFontSpaceV :: StyleState -> FontSpace Source #
Returns the vertical spacing of the given style state, or the default.
styleFontColor :: StyleState -> Color Source #
Returns the font color of the given style state, or the default.
styleTextAlignH :: StyleState -> AlignTH Source #
Returns the horizontal alignment of the given style state, or the default.
styleTextAlignV :: StyleState -> AlignTV Source #
Returns the vertical alignment of the given style state, or the default.
styleTextLineBreak :: StyleState -> LineBreak Source #
Returns the line break option of the given style state, or the
styleBgColor :: StyleState -> Color Source #
Returns the background color of the given style state, or the default.
styleFgColor :: StyleState -> Color Source #
Returns the foreground color of the given style state, or the default.
styleSndColor :: StyleState -> Color Source #
Returns the secondary color of the given style state, or the default.
styleHlColor :: StyleState -> Color Source #
Returns the highlight color of the given style state, or the default.
getOuterSize :: StyleState -> Size Source #
Returns the size used by border and padding.
addOuterSize :: StyleState -> Size -> Maybe Size Source #
Adds border and padding to the given size.
addOuterBounds :: StyleState -> Rect -> Maybe Rect Source #
Adds border and padding to the given rect.
removeOuterSize :: StyleState -> Size -> Maybe Size Source #
Removes border and padding from the given size.
removeOuterBounds :: StyleState -> Rect -> Maybe Rect Source #
Removes border and padding from the given rect.
subtractBorder :: Rect -> Maybe Border -> Maybe Rect Source #
Subtracts border widths from the given rect.
subtractPadding :: Rect -> Maybe Padding -> Maybe Rect Source #
Subbtracts padding from the given rect.
subtractBorderFromRadius :: Maybe Border -> Radius -> Radius Source #
Subtracts border width from radius. This is useful when rendering nested shapes with rounded corners, which would otherwise have gaps in the corners.
mapStyleStates :: (StyleState -> StyleState) -> Style -> Style Source #
Applies a function to all states of a given style. Useful when trying to set or reset the same property in all different states.