monomer-1.5.1.0: 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 HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Widgets.Util.Theme

Description

Helper functions for loading theme values.

Synopsis

Documentation

collectThemeField_ Source #

Arguments

:: WidgetEnv s e

The widget environment (to get the theme).

-> Lens' StyleState (Maybe t)

The target field of the style.

-> Lens' ThemeState (Maybe t)

The source field of the theme.

-> Style

The target style.

-> Style

The updated style.

Updates a the field of style with the field value from the active theme.

collectTheme Source #

Arguments

:: WidgetEnv s e

The widget environment (to get the theme).

-> Lens' ThemeState StyleState

The field into the theme

-> Style

The collected style.

Collects all the style states from a given field in the active theme.

collectUserTheme Source #

Arguments

:: WidgetEnv s e

The widget environment (to get the theme).

-> String

The key into the user map.

-> Style

The collected style.

Collects all the style states from a given entry in the map of user styles in the active theme.

setThemeValue :: Lens' ThemeState a -> a -> Theme -> Theme Source #

Sets the given value, overwriting the previous one, for each of the states of a theme.

Useful for customizing a base theme.

theme = darkTheme
  & setThemeValue L.sliderRadius (Just 10)
  & setThemeValue L.sliderWidth 10

setThemeStyle :: Lens' ThemeState StyleState -> [StyleState] -> Theme -> Theme Source #

Sets the given style options, overwriting the previous style, for each of the states of a theme.

Useful for customizing a base theme.

theme = darkTheme
  & setThemeStyle L.dropdownStyle [padding 6, paddingV 6]

Note: In most cases mergeThemeStyle is a better choice, since it keeps all the other style settings intact.

mergeThemeStyle :: Lens' ThemeState StyleState -> [StyleState] -> Theme -> Theme Source #

Merges the given style options with the existing style, for each of the states of a theme.

Useful for customizing a base theme.

theme = darkTheme
  & mergeThemeStyle L.dropdownStyle [padding 6, paddingV 6]