mirror of
https://github.com/jtdaugherty/brick.git
synced 2025-01-06 05:14:11 +03:00
Themes: add newTheme convenience constructor
This commit is contained in:
parent
2d88753db5
commit
f614977d60
@ -46,6 +46,7 @@ module Brick.Themes
|
||||
, customStyleL
|
||||
|
||||
, Theme(..)
|
||||
, newTheme
|
||||
, themeDefaultAttrL
|
||||
, themeDefaultMappingL
|
||||
, themeCustomMappingL
|
||||
@ -139,6 +140,18 @@ suffixLenses ''CustomAttr
|
||||
suffixLenses ''Theme
|
||||
suffixLenses ''ThemeDocumentation
|
||||
|
||||
-- | Create a new theme with the specified default attribute and
|
||||
-- attribute mapping. The theme will have no documentation or
|
||||
-- customizations.
|
||||
newTheme :: Attr -> [(AttrName, Attr)] -> Theme
|
||||
newTheme def mapping =
|
||||
Theme { themeDefaultAttr = def
|
||||
, themeDefaultMapping = M.fromList mapping
|
||||
, themeCustomDefaultAttr = Nothing
|
||||
, themeCustomMapping = mempty
|
||||
, themeDocumentation = ThemeDocumentation mempty
|
||||
}
|
||||
|
||||
-- | Build an 'AttrMap' from a 'Theme'. This applies all customizations
|
||||
-- in the returned 'AttrMap'.
|
||||
themeToAttrMap :: Theme -> AttrMap
|
||||
|
Loading…
Reference in New Issue
Block a user