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.Core.StyleUtil

Description

Helper functions for style types.

Synopsis

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.

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.

addBorder :: Rect -> Maybe Border -> Maybe Rect Source #

Adds border widths to the given rect.

addPadding :: Rect -> Maybe Padding -> Maybe Rect Source #

Adds padding 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.

Orphan instances

CmbStyleDisabled Style Source # 
Instance details

CmbStyleActive Style Source # 
Instance details

CmbStyleFocusHover Style Source # 
Instance details

CmbStyleFocus Style Source # 
Instance details

CmbStyleHover Style Source # 
Instance details

CmbStyleBasic Style Source # 
Instance details

CmbStyleDisabled (WidgetNode s e) Source # 
Instance details

CmbStyleActive (WidgetNode s e) Source # 
Instance details

CmbStyleFocusHover (WidgetNode s e) Source # 
Instance details

CmbStyleFocus (WidgetNode s e) Source # 
Instance details

CmbStyleHover (WidgetNode s e) Source # 
Instance details

CmbStyleBasic (WidgetNode s e) Source # 
Instance details