brick 0.34 → 0.34.1
raw patch · 5 files changed
+30/−6 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Brick.Types: cursorLocationL :: forall n_asrj. Lens' (CursorLocation n_asrj) Location
+ Brick.Types: cursorLocationL :: forall n_asww. Lens' (CursorLocation n_asww) Location
- Brick.Types: cursorLocationNameL :: forall n_asrj n_asUU. Lens (CursorLocation n_asrj) (CursorLocation n_asUU) (Maybe n_asrj) (Maybe n_asUU)
+ Brick.Types: cursorLocationNameL :: forall n_asww n_at07. Lens (CursorLocation n_asww) (CursorLocation n_at07) (Maybe n_asww) (Maybe n_at07)
- Brick.Types: cursorsL :: forall n_asri. Lens' (Result n_asri) [CursorLocation n_asri]
+ Brick.Types: cursorsL :: forall n_aswv. Lens' (Result n_aswv) [CursorLocation n_aswv]
- Brick.Types: extentsL :: forall n_asri. Lens' (Result n_asri) [Extent n_asri]
+ Brick.Types: extentsL :: forall n_aswv. Lens' (Result n_aswv) [Extent n_aswv]
- Brick.Types: imageL :: forall n_asri. Lens' (Result n_asri) Image
+ Brick.Types: imageL :: forall n_aswv. Lens' (Result n_aswv) Image
- Brick.Types: visibilityRequestsL :: forall n_asri. Lens' (Result n_asri) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_aswv. Lens' (Result n_aswv) [VisibilityRequest]
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_aQgC a_aQhi. Lens (Dialog a_aQgC) (Dialog a_aQhi) [(String, a_aQgC)] [(String, a_aQhi)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_aQlP a_aQmv. Lens (Dialog a_aQlP) (Dialog a_aQmv) [(String, a_aQlP)] [(String, a_aQmv)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_aQgC. Lens' (Dialog a_aQgC) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_aQlP. Lens' (Dialog a_aQlP) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_aQgC. Lens' (Dialog a_aQgC) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_aQlP. Lens' (Dialog a_aQlP) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_aQgC. Lens' (Dialog a_aQgC) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_aQlP. Lens' (Dialog a_aQlP) Int
- Brick.Widgets.Edit: editContentsL :: forall t_aMjc n_aMjd t_aMjU. Lens (Editor t_aMjc n_aMjd) (Editor t_aMjU n_aMjd) (TextZipper t_aMjc) (TextZipper t_aMjU)
+ Brick.Widgets.Edit: editContentsL :: forall t_aMop n_aMoq t_aMp7. Lens (Editor t_aMop n_aMoq) (Editor t_aMp7 n_aMoq) (TextZipper t_aMop) (TextZipper t_aMp7)
- Brick.Widgets.List: listElementsL :: forall n_aYvy e_aYvz e_aYGe. Lens (List n_aYvy e_aYvz) (List n_aYvy e_aYGe) (Vector e_aYvz) (Vector e_aYGe)
+ Brick.Widgets.List: listElementsL :: forall n_aYAL e_aYAM e_aYLr. Lens (List n_aYAL e_aYAM) (List n_aYAL e_aYLr) (Vector e_aYAM) (Vector e_aYLr)
- Brick.Widgets.List: listItemHeightL :: forall n_aYvy e_aYvz. Lens' (List n_aYvy e_aYvz) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_aYAL e_aYAM. Lens' (List n_aYAL e_aYAM) Int
- Brick.Widgets.List: listNameL :: forall n_aYvy e_aYvz n_aYGf. Lens (List n_aYvy e_aYvz) (List n_aYGf e_aYvz) n_aYvy n_aYGf
+ Brick.Widgets.List: listNameL :: forall n_aYAL e_aYAM n_aYLs. Lens (List n_aYAL e_aYAM) (List n_aYLs e_aYAM) n_aYAL n_aYLs
- Brick.Widgets.List: listSelectedL :: forall n_aYvy e_aYvz. Lens' (List n_aYvy e_aYvz) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_aYAL e_aYAM. Lens' (List n_aYAL e_aYAM) (Maybe Int)
Files
- CHANGELOG.md +12/−0
- brick.cabal +1/−1
- docs/guide.rst +12/−3
- docs/samtay-tutorial.md +1/−0
- src/Brick/Themes.hs +4/−2
CHANGELOG.md view
@@ -2,6 +2,18 @@ Brick changelog --------------- +0.34.1+------++Bug fixes:+ * Fixed a bug where the "reverseVideo" style could not be parsed in a+ theme customization when it was all lowercase (thanks Yuriy Lazarev)++Documentation changes:+ * Guide: added more complete example of creating a default theme+ (thanks Mark Wales)+ * Guide: added offset to Extent pattern matching (thanks Mark Wales)+ 0.34 ----
brick.cabal view
@@ -1,5 +1,5 @@ name: brick-version: 0.34+version: 0.34.1 synopsis: A declarative terminal user interface library description: Write terminal applications painlessly with 'brick'! You write an
docs/guide.rst view
@@ -90,6 +90,12 @@ produce executable examples, but rather to guide you in writing your ``import`` statements. +Compiling Brick Applications+============================++Brick applications must be compiled with the threaded RTS using the GHC+``-threaded`` option.+ The App Type ============ @@ -797,12 +803,15 @@ .. code:: haskell import Brick.Themes (Theme, newTheme)+ import Brick (attrName)+ import Brick.Util (fg, on)+ import Graphics.Vty (defAttr, white, blue, yellow, magenta) defaultTheme :: Theme defaultTheme = newTheme (white `on` blue)- [ ("someAttribute", fg yellow)- , ("otherAttribute", fg magenta)+ [ (attrName "someAttribute", fg yellow)+ , (attrName "otherAttribute", fg magenta) ] Notice that the attributes in the theme have defaults: ``someAttribute``@@ -905,7 +914,7 @@ mExtent <- Brick.Main.lookupExtent FooBox case mExtent of Nothing -> ...- Just (Extent _ upperLeft (width, height)) -> ...+ Just (Extent _ upperLeft (width, height) offset) -> ... Paste Support =============
docs/samtay-tutorial.md view
@@ -83,6 +83,7 @@ executable snake hs-source-dirs: src main-is: Main.hs+ ghc-options: -threaded exposed-modules: Snake , UI default-language: Haskell2010
src/Brick/Themes.hs view
@@ -223,7 +223,7 @@ allStyles = [ ("standout", standout) , ("underline", underline)- , ("reverseVideo", reverseVideo)+ , ("reversevideo", reverseVideo) , ("blink", blink) , ("dim", dim) , ("bold", bold)@@ -231,10 +231,12 @@ parseStyle :: T.Text -> Either String Style parseStyle s =- let lookupStyle n = case lookup n allStyles of+ let lookupStyle n = case lookup n normalizedStyles of Just sty -> Right sty Nothing -> Left $ T.unpack $ "Invalid style: " <> n stripped = T.strip $ T.toLower s+ normalize (n, a) = (T.toLower n, a)+ normalizedStyles = normalize <$> allStyles bracketed = "[" `T.isPrefixOf` stripped && "]" `T.isSuffixOf` stripped unbracketed = T.tail $ T.init stripped