Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Helper functions for loading theme values.
Synopsis
- collectThemeField_ :: WidgetEnv s e -> Lens' StyleState (Maybe t) -> Lens' ThemeState (Maybe t) -> Style -> Style
- collectTheme :: WidgetEnv s e -> Lens' ThemeState StyleState -> Style
- collectUserTheme :: WidgetEnv s e -> String -> Style
- setThemeValue :: Lens' ThemeState a -> a -> Theme -> Theme
- setThemeStyle :: Lens' ThemeState StyleState -> [StyleState] -> Theme -> Theme
- mergeThemeStyle :: Lens' ThemeState StyleState -> [StyleState] -> Theme -> Theme
Documentation
:: 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.
:: 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.
:: 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]