packages feed

reflex-vty 0.3.0.0 → 0.3.1.0

raw patch · 3 files changed

+20/−11 lines, 3 filesdep ~basedep ~hspecdep ~vty

Dependency ranges changed: base, hspec, vty

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for reflex-vty +## 0.3.1.0++* Replace `mempty` with `defAttr` for Attr from Graphics.Vty to make it compatible with vty-5.34+ ## 0.3.0.0  * Re-design `textInput`, `TextInput` and `TextInputConfig`.
reflex-vty.cabal view
@@ -1,5 +1,5 @@ name: reflex-vty-version: 0.3.0.0+version: 0.3.1.0 synopsis: Reflex FRP host and widgets for VTY applications description:   Build terminal applications using functional reactive programming (FRP) with Reflex FRP (<https://reflex-frp.org>).@@ -18,7 +18,7 @@   ChangeLog.md extra-doc-files: doc/tasks.png tested-with:-  GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2+  GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7  source-repository head   type: git@@ -39,7 +39,7 @@                  , Reflex.Spider.Orphans                  , Control.Monad.NodeId   build-depends:-    base >= 4.10.0 && < 4.15,+    base >= 4.10.0 && < 4.16,     bimap >= 0.3.3 && < 0.5,     containers >= 0.5.0 && < 0.7,     mtl >= 2.2.2 && < 2.3,@@ -56,7 +56,7 @@     ref-tf >= 0.4.0 && < 0.6,     reflex >= 0.8 && < 0.9,     time >= 1.8.0 && < 1.10,-    vty >= 5.28 && < 5.34+    vty >= 5.28 && < 5.38   hs-source-dirs: src   default-language: Haskell2010   ghc-options: -Wall@@ -150,5 +150,5 @@     reflex-vty,     text,     extra,-    hspec >= 2.7 && < 2.8+    hspec >= 2.7 && < 2.9   default-language: Haskell2010
src/Reflex/Vty/Widget/Input.hs view
@@ -14,6 +14,7 @@ import Control.Monad (join) import Control.Monad.Fix (MonadFix) import Data.Default (Default(..))+import Data.List (foldl') import Data.Text (Text) import qualified Graphics.Vty as V import Reflex@@ -144,15 +145,19 @@     , not <$ space     , const <$> _checkboxConfig_setValue cfg     ]-  let bold = V.withStyle mempty V.bold-  depressed <- hold mempty $ leftmost-    [ bold <$ md-    , mempty <$ mu+  depressed <- hold V.defaultStyleMask $ leftmost+    [ V.bold <$ md+    , V.defaultStyleMask <$ mu     ]-  let focused = ffor (current f) $ \x -> if x then bold else mempty-  let attrs = mconcat <$> sequence [_checkboxConfig_attributes cfg, depressed, focused]+  let focused = ffor (current f) $ \x -> if x then V.bold else V.defaultStyleMask+  let attrs = combineStyles+        <$> _checkboxConfig_attributes cfg+        <*> sequence [depressed, focused]   richText (RichTextConfig attrs) $ join . current $ ffor v $ \checked ->     if checked       then _checkboxStyle_checked <$> _checkboxConfig_checkboxStyle cfg       else _checkboxStyle_unchecked <$> _checkboxConfig_checkboxStyle cfg   return v+  where+    combineStyles :: V.Attr -> [V.Style] -> V.Attr+    combineStyles x xs = foldl' V.withStyle x xs