packages feed

brick 0.23 → 0.24

raw patch · 4 files changed

+25/−1 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Brick.Widgets.Core: setAvailableSize :: (Int, Int) -> Widget n -> Widget n
- Brick.Types: cursorLocationL :: forall n_aqfJ. Lens' (CursorLocation n_aqfJ) Location
+ Brick.Types: cursorLocationL :: forall n_aqfS. Lens' (CursorLocation n_aqfS) Location
- Brick.Types: cursorLocationNameL :: forall n_aqfJ n_aqJn. Lens (CursorLocation n_aqfJ) (CursorLocation n_aqJn) (Maybe n_aqfJ) (Maybe n_aqJn)
+ Brick.Types: cursorLocationNameL :: forall n_aqfS n_aqJI. Lens (CursorLocation n_aqfS) (CursorLocation n_aqJI) (Maybe n_aqfS) (Maybe n_aqJI)
- Brick.Types: cursorsL :: forall n_aqeE. Lens' (Result n_aqeE) [CursorLocation n_aqeE]
+ Brick.Types: cursorsL :: forall n_aqeN. Lens' (Result n_aqeN) [CursorLocation n_aqeN]
- Brick.Types: extentsL :: forall n_aqeE. Lens' (Result n_aqeE) [Extent n_aqeE]
+ Brick.Types: extentsL :: forall n_aqeN. Lens' (Result n_aqeN) [Extent n_aqeN]
- Brick.Types: imageL :: forall n_aqeE. Lens' (Result n_aqeE) Image
+ Brick.Types: imageL :: forall n_aqeN. Lens' (Result n_aqeN) Image
- Brick.Types: visibilityRequestsL :: forall n_aqeE. Lens' (Result n_aqeE) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_aqeN. Lens' (Result n_aqeN) [VisibilityRequest]
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a14qB a_a14rb. Lens (Dialog a_a14qB) (Dialog a_a14rb) [(String, a_a14qB)] [(String, a_a14rb)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a14wH a_a14xh. Lens (Dialog a_a14wH) (Dialog a_a14xh) [(String, a_a14wH)] [(String, a_a14xh)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a14qB. Lens' (Dialog a_a14qB) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a14wH. Lens' (Dialog a_a14wH) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a14qB. Lens' (Dialog a_a14qB) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a14wH. Lens' (Dialog a_a14wH) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a14qB. Lens' (Dialog a_a14qB) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a14wH. Lens' (Dialog a_a14wH) Int
- Brick.Widgets.Edit: editContentsL :: forall t_a16bJ n_a16bK t_a16cl. Lens (Editor t_a16bJ n_a16bK) (Editor t_a16cl n_a16bK) (TextZipper t_a16bJ) (TextZipper t_a16cl)
+ Brick.Widgets.Edit: editContentsL :: forall t_a16hR n_a16hS t_a16it. Lens (Editor t_a16hR n_a16hS) (Editor t_a16it n_a16hS) (TextZipper t_a16hR) (TextZipper t_a16it)
- Brick.Widgets.List: listElementsL :: forall n_a17ZD e_a17ZE e_a189S. Lens (List n_a17ZD e_a17ZE) (List n_a17ZD e_a189S) (Vector e_a17ZE) (Vector e_a189S)
+ Brick.Widgets.List: listElementsL :: forall n_a185N e_a185O e_a18g2. Lens (List n_a185N e_a185O) (List n_a185N e_a18g2) (Vector e_a185O) (Vector e_a18g2)
- Brick.Widgets.List: listItemHeightL :: forall n_a17ZD e_a17ZE. Lens' (List n_a17ZD e_a17ZE) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a185N e_a185O. Lens' (List n_a185N e_a185O) Int
- Brick.Widgets.List: listNameL :: forall n_a17ZD e_a17ZE n_a189T. Lens (List n_a17ZD e_a17ZE) (List n_a189T e_a17ZE) n_a17ZD n_a189T
+ Brick.Widgets.List: listNameL :: forall n_a185N e_a185O n_a18g3. Lens (List n_a185N e_a185O) (List n_a18g3 e_a185O) n_a185N n_a18g3
- Brick.Widgets.List: listSelectedL :: forall n_a17ZD e_a17ZE. Lens' (List n_a17ZD e_a17ZE) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a185N e_a185O. Lens' (List n_a185N e_a185O) (Maybe Int)

Files

CHANGELOG.md view
@@ -2,6 +2,18 @@ Brick changelog --------------- +0.24+----++API changes:+ * Added Brick.Widgets.Core.setAvailableSize to control rendering+   context size in cases where the screen size is too constraining (e.g.+   for a floating layer that might be bigger than the screen)          .++Documentation changes:+ * Samuel Tay has contributed his wonderful Brick tutorial to this+   package in docs/samtay-tutorial.md. Thank you!+ 0.23 ---- 
README.md view
@@ -57,6 +57,7 @@  * `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+ * `tart`, a mouse-driven ASCII art drawing program: https://github.com/jtdaugherty/tart  Getting Started ---------------@@ -110,6 +111,7 @@  * [FAQ](https://github.com/jtdaugherty/brick/blob/master/FAQ.md) * [The brick user guide](https://github.com/jtdaugherty/brick/blob/master/docs/guide.rst)+* [Samuel Tay's brick tutorial](https://github.com/jtdaugherty/brick/blob/master/docs/samtay-tutorial.md) * Haddock (all modules) * [Demo programs](https://github.com/jtdaugherty/brick/blob/master/programs) 
brick.cabal view
@@ -1,5 +1,5 @@ name:                brick-version:             0.23+version:             0.24 synopsis:            A declarative terminal user interface library description:   Write terminal applications painlessly with 'brick'! You write an
src/Brick/Widgets/Core.hs view
@@ -37,6 +37,7 @@   -- * Limits   , hLimit   , vLimit+  , setAvailableSize    -- * Attribute management   , withDefAttr@@ -551,6 +552,15 @@ vLimit h p =     Widget (hSize p) Fixed $       withReaderT (& availHeightL .~ h) $ render $ cropToContext p++-- | Set the rendering context height and width for this widget. This+-- is useful for relaxing the rendering size constraints on e.g. layer+-- widgets where cropping to the screen size is undesirable.+setAvailableSize :: (Int, Int) -> Widget n -> Widget n+setAvailableSize (w, h) p =+    Widget Fixed Fixed $+      withReaderT (\c -> c & availHeightL .~ h & availWidthL .~ w) $+        render $ cropToContext p  -- | When drawing the specified widget, set the current attribute used -- for drawing to the one with the specified name. Note that the widget