brick 0.20.1 → 0.21
raw patch · 7 files changed
+58/−8 lines, 7 filesdep ~microlensdep ~word-wrapnew-component:exe:brick-fill-demoPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: microlens, word-wrap
API changes (from Hackage documentation)
- Brick.Types: cursorLocationL :: forall n_aqfx. Lens' (CursorLocation n_aqfx) Location
+ Brick.Types: cursorLocationL :: forall n_aqfI. Lens' (CursorLocation n_aqfI) Location
- Brick.Types: cursorLocationNameL :: forall n_aqfx n_aqIZ. Lens (CursorLocation n_aqfx) (CursorLocation n_aqIZ) (Maybe n_aqfx) (Maybe n_aqIZ)
+ Brick.Types: cursorLocationNameL :: forall n_aqfI n_aqJm. Lens (CursorLocation n_aqfI) (CursorLocation n_aqJm) (Maybe n_aqfI) (Maybe n_aqJm)
- Brick.Types: cursorsL :: forall n_aqes. Lens' (Result n_aqes) [CursorLocation n_aqes]
+ Brick.Types: cursorsL :: forall n_aqeD. Lens' (Result n_aqeD) [CursorLocation n_aqeD]
- Brick.Types: extentsL :: forall n_aqes. Lens' (Result n_aqes) [Extent n_aqes]
+ Brick.Types: extentsL :: forall n_aqeD. Lens' (Result n_aqeD) [Extent n_aqeD]
- Brick.Types: imageL :: forall n_aqes. Lens' (Result n_aqes) Image
+ Brick.Types: imageL :: forall n_aqeD. Lens' (Result n_aqeD) Image
- Brick.Types: visibilityRequestsL :: forall n_aqes. Lens' (Result n_aqes) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_aqeD. Lens' (Result n_aqeD) [VisibilityRequest]
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a14pN a_a14qn. Lens (Dialog a_a14pN) (Dialog a_a14qn) [(String, a_a14pN)] [(String, a_a14qn)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a14qr a_a14r1. Lens (Dialog a_a14qr) (Dialog a_a14r1) [(String, a_a14qr)] [(String, a_a14r1)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a14pN. Lens' (Dialog a_a14pN) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a14qr. Lens' (Dialog a_a14qr) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a14pN. Lens' (Dialog a_a14pN) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a14qr. Lens' (Dialog a_a14qr) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a14pN. Lens' (Dialog a_a14pN) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a14qr. Lens' (Dialog a_a14qr) Int
- Brick.Widgets.Edit: editContentsL :: forall t_a16aV n_a16aW t_a16bx. Lens (Editor t_a16aV n_a16aW) (Editor t_a16bx n_a16aW) (TextZipper t_a16aV) (TextZipper t_a16bx)
+ Brick.Widgets.Edit: editContentsL :: forall t_a16bz n_a16bA t_a16cb. Lens (Editor t_a16bz n_a16bA) (Editor t_a16cb n_a16bA) (TextZipper t_a16bz) (TextZipper t_a16cb)
- Brick.Widgets.List: listElementsL :: forall n_a17YP e_a17YQ e_a1894. Lens (List n_a17YP e_a17YQ) (List n_a17YP e_a1894) (Vector e_a17YQ) (Vector e_a1894)
+ Brick.Widgets.List: listElementsL :: forall n_a17Zt e_a17Zu e_a189I. Lens (List n_a17Zt e_a17Zu) (List n_a17Zt e_a189I) (Vector e_a17Zu) (Vector e_a189I)
- Brick.Widgets.List: listItemHeightL :: forall n_a17YP e_a17YQ. Lens' (List n_a17YP e_a17YQ) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a17Zt e_a17Zu. Lens' (List n_a17Zt e_a17Zu) Int
- Brick.Widgets.List: listNameL :: forall n_a17YP e_a17YQ n_a1895. Lens (List n_a17YP e_a17YQ) (List n_a1895 e_a17YQ) n_a17YP n_a1895
+ Brick.Widgets.List: listNameL :: forall n_a17Zt e_a17Zu n_a189J. Lens (List n_a17Zt e_a17Zu) (List n_a189J e_a17Zu) n_a17Zt n_a189J
- Brick.Widgets.List: listSelectedL :: forall n_a17YP e_a17YQ. Lens' (List n_a17YP e_a17YQ) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a17Zt e_a17Zu. Lens' (List n_a17Zt e_a17Zu) (Maybe Int)
Files
- CHANGELOG.md +10/−0
- README.md +13/−0
- brick.cabal +16/−3
- programs/FillDemo.hs +12/−0
- src/Brick/Types/Internal.hs +4/−2
- src/Brick/Widgets/Core.hs +2/−2
- src/Brick/Widgets/Edit.hs +1/−1
CHANGELOG.md view
@@ -2,6 +2,16 @@ Brick changelog --------------- +0.21+----++Package changes:+ * Upgrade to word-wrap 0.2++Other changes:+ * Brick.Types.Internal: improve mouse constructor haddock+ * Add a basic fill demonstration program (FillDemo.hs)+ 0.20.1 ------
README.md view
@@ -45,6 +45,19 @@ └────────────────────────┘ ``` +Featured Projects+-----------------++To give you an idea of what some people have done with `brick`, take a+look at these projects:++ * `tetris`: https://github.com/SamTay/tetris+ * `gotta-go-fast`, a typing tutor: https://github.com/hot-leaf-juice/gotta-go-fast+ * `haskell-player`, an `afplay` frontend: https://github.com/potomak/haskell-player+ * `mushu`, an `MPD` client: https://github.com/elaye/mushu+ * `matterhorn`, a client for [Mattermost](https://about.mattermost.com/): https://github.com/matterhorn-chat/matterhorn+ * `viewprof`, a GHC profile viewer: https://github.com/maoe/viewprof+ Getting Started ---------------
brick.cabal view
@@ -1,5 +1,5 @@ name: brick-version: 0.20.1+version: 0.21 synopsis: A declarative terminal user interface library description: Write terminal applications painlessly with 'brick'! You write an@@ -34,7 +34,7 @@ copyright: (c) Jonathan Daugherty 2015-2016 category: Graphics build-type: Simple-cabal-version: >=1.10+cabal-version: >=1.18 Homepage: https://github.com/jtdaugherty/brick/ Bug-reports: https://github.com/jtdaugherty/brick/issues @@ -94,7 +94,7 @@ text-zipper >= 0.7.1, template-haskell, deepseq >= 1.3 && < 1.5,- word-wrap+ word-wrap >= 0.2 executable brick-readme-demo if !flag(demos)@@ -285,6 +285,19 @@ text, microlens >= 0.3.0.0, microlens-th++executable brick-fill-demo+ if !flag(demos)+ Buildable: False+ hs-source-dirs: programs+ ghc-options: -threaded -Wall -fno-warn-unused-do-bind -O3+ default-language: Haskell2010+ main-is: FillDemo.hs+ build-depends: base <= 5,+ brick,+ vty >= 5.15,+ text,+ microlens executable brick-hello-world-demo if !flag(demos)
+ programs/FillDemo.hs view
@@ -0,0 +1,12 @@+module Main where++import Brick++ui :: Widget ()+ui = vBox [ str "This text is at the top."+ , fill ' '+ , str "This text is at the bottom."+ ]++main :: IO ()+main = simpleMain ui
src/Brick/Types/Internal.hs view
@@ -204,10 +204,12 @@ -- ^ The event was an application event. | MouseDown n Button [Modifier] Location -- ^ A mouse-down event on the specified region was- -- received.+ -- received. The 'n' value is the resource name of+ -- the clicked widget (see 'clickable'). | MouseUp n (Maybe Button) Location -- ^ A mouse-up event on the specified region was- -- received.+ -- received. The 'n' value is the resource name of+ -- the clicked widget (see 'clickable'). deriving (Show, Eq) data RenderState n =
src/Brick/Widgets/Core.hs view
@@ -103,7 +103,7 @@ import qualified Graphics.Vty as V import Control.DeepSeq -import Text.Wrap (wrapTextToLines)+import Text.Wrap (wrapTextToLines, defaultWrapSettings) import Brick.Types import Brick.Types.Internal@@ -214,7 +214,7 @@ txtWrap s = Widget Fixed Fixed $ do c <- getContext- let theLines = fixEmpty <$> wrapTextToLines (c^.availWidthL) s+ let theLines = fixEmpty <$> wrapTextToLines defaultWrapSettings (c^.availWidthL) s fixEmpty l | T.null l = " " | otherwise = l case force theLines of
src/Brick/Widgets/Edit.hs view
@@ -4,7 +4,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} -- | This module provides a basic text editor widget. You'll need to -- embed an 'Editor' in your application state and transform it with--- 'handleEvent' when relevant events arrive. To get the contents+-- 'handleEditorEvent' when relevant events arrive. To get the contents -- of the editor, just use 'getEditContents'. To modify it, use the -- 'Z.TextZipper' interface with 'applyEdit'. --