Skip to content

Commit 0ca5375

Browse files
authored
Merge pull request #61 from reflex-frp/aa/bump-vty-5.37
Build against vty-5.37
2 parents ccf34be + ffbf898 commit 0ca5375

File tree

7 files changed

+32
-19
lines changed

7 files changed

+32
-19
lines changed

.github/workflows/haskell.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ jobs:
66
build:
77
strategy:
88
matrix:
9-
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.2']
9+
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7']
1010
os: ['ubuntu-latest', 'macos-latest']
1111
runs-on: ${{ matrix.os }}
1212

1313
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
1414
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-haskell@v1
15+
- uses: actions/checkout@v3
16+
- uses: haskell/actions/setup@v2
1717
with:
1818
ghc-version: ${{ matrix.ghc }}
1919
- name: Cache

ChangeLog.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Revision history for reflex-vty
22

3+
## 0.3.1.0
4+
5+
* Replace `mempty` with `defAttr` for Attr from Graphics.Vty to make it compatible with vty-5.34
6+
37
## 0.3.0.0
48

59
* Re-design `textInput`, `TextInput` and `TextInputConfig`.

reflex-platform/github.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"repo": "reflex-platform",
44
"branch": "develop",
55
"private": false,
6-
"rev": "f019863c21ee85498e6a6e0072e617b2462b70ed",
7-
"sha256": "146xfjqdwd55s9jg1ggi6akcxxxd5c0pvc4bpjx3whwiikpcv8y4"
6+
"rev": "6c8830e059a6d2859cb1b65acefed3c2f1d216d3",
7+
"sha256": "06kv45yq8qan0p22wzj5c9mx11ns1wddyqjr1xasjjkf6gaf0080"
88
}

reflex-platform/thunk.nix

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
33
if !fetchSubmodules && !private then builtins.fetchTarball {
44
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
5-
} else (import <nixpkgs> {}).fetchFromGitHub {
5+
} else (import (builtins.fetchTarball {
6+
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
7+
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
8+
}) {}).fetchFromGitHub {
69
inherit owner repo rev sha256 fetchSubmodules private;
710
};
811
json = builtins.fromJSON (builtins.readFile ./github.json);

reflex-vty.cabal

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: reflex-vty
2-
version: 0.3.0.0
2+
version: 0.3.1.0
33
synopsis: Reflex FRP host and widgets for VTY applications
44
description:
55
Build terminal applications using functional reactive programming (FRP) with Reflex FRP (<https://reflex-frp.org>).
@@ -18,7 +18,7 @@ extra-source-files:
1818
ChangeLog.md
1919
extra-doc-files: doc/tasks.png
2020
tested-with:
21-
GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2
21+
GHC ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7
2222

2323
source-repository head
2424
type: git
@@ -56,7 +56,7 @@ library
5656
ref-tf >= 0.4.0 && < 0.6,
5757
reflex >= 0.8 && < 0.9,
5858
time >= 1.8.0 && < 1.10,
59-
vty >= 5.28 && < 5.34
59+
vty >= 5.28 && < 5.38
6060
hs-source-dirs: src
6161
default-language: Haskell2010
6262
ghc-options: -Wall

release.nix

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
let inherit (reflex-platform.nixpkgs.haskell) lib;
44
ghc = reflex-platform.ghc.override {
55
overrides = self: super: {
6-
vty = self.callHackage "vty" "5.28" {};
7-
ansi-terminal = self.callHackage "ansi-terminal" "0.10.3" {};
8-
ansi-wl-pprint = self.callHackage "ansi-wl-pprint" "0.6.9" {};
9-
test-framework = lib.doJailbreak super.test-framework;
6+
vty = self.callHackageDirect {
7+
pkg = "vty";
8+
ver = "5.37";
9+
sha256 = "01ppspii5x02iik9rxkf2idi6r9ngax6w3mqi6d8qj765w3cksiq";
10+
} {};
1011
};
1112
};
1213
in

src/Reflex/Vty/Widget/Input.hs

+11-6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Reflex.Vty.Widget.Input.Text as Export
1414
import Control.Monad (join)
1515
import Control.Monad.Fix (MonadFix)
1616
import Data.Default (Default(..))
17+
import Data.List (foldl')
1718
import Data.Text (Text)
1819
import qualified Graphics.Vty as V
1920
import Reflex
@@ -144,15 +145,19 @@ checkbox cfg v0 = do
144145
, not <$ space
145146
, const <$> _checkboxConfig_setValue cfg
146147
]
147-
let bold = V.withStyle V.defAttr V.bold
148-
depressed <- hold V.defAttr $ leftmost
149-
[ bold <$ md
150-
, V.defAttr <$ mu
148+
depressed <- hold V.defaultStyleMask $ leftmost
149+
[ V.bold <$ md
150+
, V.defaultStyleMask <$ mu
151151
]
152-
let focused = ffor (current f) $ \x -> if x then bold else V.defAttr
153-
let attrs = mconcat <$> sequence [_checkboxConfig_attributes cfg, depressed, focused]
152+
let focused = ffor (current f) $ \x -> if x then V.bold else V.defaultStyleMask
153+
let attrs = combineStyles
154+
<$> _checkboxConfig_attributes cfg
155+
<*> sequence [depressed, focused]
154156
richText (RichTextConfig attrs) $ join . current $ ffor v $ \checked ->
155157
if checked
156158
then _checkboxStyle_checked <$> _checkboxConfig_checkboxStyle cfg
157159
else _checkboxStyle_unchecked <$> _checkboxConfig_checkboxStyle cfg
158160
return v
161+
where
162+
combineStyles :: V.Attr -> [V.Style] -> V.Attr
163+
combineStyles x xs = foldl' V.withStyle x xs

0 commit comments

Comments
 (0)