Compare commits
3 Commits
bump-versi
...
arm64-dock
| Author | SHA1 | Date | |
|---|---|---|---|
| d0538a50e0 | |||
| 318ac21e41 | |||
| 3e9bb7c369 |
2
.github/workflows/docker.yaml
vendored
2
.github/workflows/docker.yaml
vendored
@@ -57,6 +57,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/ubuntu:focal
|
- uses: docker://arm64v8/ubuntu:focal
|
||||||
name: Cleanup (aarch64 linux)
|
name: Cleanup (aarch64 linux)
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
@@ -93,6 +94,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/ubuntu:focal
|
- uses: docker://arm64v8/ubuntu:focal
|
||||||
name: Cleanup (aarch64 linux)
|
name: Cleanup (aarch64 linux)
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -105,6 +105,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/debian:10
|
- uses: docker://arm64v8/debian:10
|
||||||
name: Cleanup (aarch64 linux)
|
name: Cleanup (aarch64 linux)
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
@@ -348,6 +349,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: docker://arm64v8/debian:10
|
- uses: docker://arm64v8/debian:10
|
||||||
name: Cleanup (aarch64 linux)
|
name: Cleanup (aarch64 linux)
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
{-# LANGUAGE BangPatterns #-}
|
{-# LANGUAGE BangPatterns #-}
|
||||||
|
{-# LANGUAGE ViewPatterns #-}
|
||||||
|
|
||||||
module BrickMain where
|
module BrickMain where
|
||||||
|
|
||||||
@@ -202,34 +203,35 @@ handleGenericListEvent (VtyEvent ev) = do
|
|||||||
handleGenericListEvent _ = pure ()
|
handleGenericListEvent _ = pure ()
|
||||||
|
|
||||||
-- This re-uses Brick.Widget.List.renderList
|
-- This re-uses Brick.Widget.List.renderList
|
||||||
renderSectionList :: (Traversable t, Ord n, Show n, Eq n, L.Splittable t)
|
renderSectionList :: forall n t e . (Traversable t, Ord n, Show n, Eq n, L.Splittable t, Semigroup (t e))
|
||||||
=> (Bool -> e -> Widget n) -- ^ Rendering function of the list element, True for the selected element
|
=> (Bool -> e -> Widget n) -- ^ Rendering function of the list element, True for the selected element
|
||||||
-> Bool -- ^ Whether the section list has focus
|
-> Bool -- ^ Whether the section list has focus
|
||||||
-> GenericSectionList n t e -- ^ The section list to render
|
-> GenericSectionList n t e -- ^ The section list to render
|
||||||
-> Widget n
|
-> Widget n
|
||||||
renderSectionList render_elem section_focus (GenericSectionList focus elms sl_name) =
|
renderSectionList renderElem sectionFocus ge@(GenericSectionList focus elms slName) =
|
||||||
Brick.Widget Brick.Greedy Brick.Greedy $ do
|
Brick.Widget Brick.Greedy Brick.Greedy $ Brick.render $ Brick.viewport slName Brick.Vertical $
|
||||||
c <- Brick.getContext
|
V.ifoldl' (\(!accWidget) !i list ->
|
||||||
let -- A section is focused if the whole thing is focused, and the inner list has focus
|
let hasFocusList = sectionIsFocused list
|
||||||
section_is_focused l = section_focus && (Just (L.listName l) == F.focusGetCurrent focus)
|
makeVisible = if hasFocusList then Brick.visibleRegion (Brick.Location (c, r)) (1, 1) else id
|
||||||
-- We need to limit the widget size when the length of the list is higher than the size of the terminal
|
appendBorder = if i == 0 then id else (hBorder <=>)
|
||||||
limit = min (Brick.windowHeight c) (Brick.availHeight c)
|
newWidget = appendBorder (makeVisible $ renderInnerList hasFocusList list)
|
||||||
s_idx = fromMaybe 0 $ V.findIndex section_is_focused elms
|
in accWidget <=> newWidget
|
||||||
render_inner_list has_focus l = Brick.vLimit (length l) $ L.renderList (\b -> render_elem (b && has_focus)) has_focus l
|
)
|
||||||
(widget, off) =
|
Brick.emptyWidget
|
||||||
V.ifoldl' (\wacc i list ->
|
elms
|
||||||
let has_focus_list = section_is_focused list
|
where
|
||||||
(!acc_widget, !acc_off) = wacc
|
-- A section is focused if the whole thing is focused, and the inner list has focus
|
||||||
new_widget = if i == 0 then render_inner_list has_focus_list list else hBorder <=> render_inner_list has_focus_list list
|
sectionIsFocused :: L.GenericList n t e -> Bool
|
||||||
new_off
|
sectionIsFocused l = sectionFocus && (Just (L.listName l) == F.focusGetCurrent focus)
|
||||||
| i < s_idx = 1 + L.listItemHeight list * length list
|
|
||||||
| i == s_idx = 1 + L.listItemHeight list * fromMaybe 0 (L.listSelected list)
|
renderInnerList :: Bool -> L.GenericList n t e -> Widget n
|
||||||
| otherwise = 0
|
renderInnerList hasFocus l = Brick.vLimit (length l) $ L.renderList (\b -> renderElem (b && hasFocus)) hasFocus l
|
||||||
in (acc_widget <=> new_widget, acc_off + new_off)
|
|
||||||
)
|
-- compute the location to focus on within the active section
|
||||||
(Brick.emptyWidget, 0)
|
(c, r) :: (Int, Int) = case sectionListSelectedElement ge of
|
||||||
elms
|
Nothing -> (0, 0)
|
||||||
Brick.render $ Brick.viewport sl_name Brick.Vertical $ Brick.translateBy (Brick.Location (0, min 0 (limit-off))) widget
|
Just (selElIx, _) -> (0, selElIx)
|
||||||
|
|
||||||
|
|
||||||
-- | Equivalent to listSelectedElement
|
-- | Equivalent to listSelectedElement
|
||||||
sectionListSelectedElement :: (Eq n, L.Splittable t, Traversable t, Semigroup (t e)) => GenericSectionList n t e -> Maybe (Int, e)
|
sectionListSelectedElement :: (Eq n, L.Splittable t, Traversable t, Semigroup (t e)) => GenericSectionList n t e -> Maybe (Int, e)
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
|
source-repository-package
|
||||||
|
type: git
|
||||||
|
location: https://github.com/hasufell/versions.git
|
||||||
|
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ constraints: any.Cabal ==3.6.3.0,
|
|||||||
vector +boundschecks -internalchecks -unsafechecks -wall,
|
vector +boundschecks -internalchecks -unsafechecks -wall,
|
||||||
any.vector-binary-instances ==0.2.5.2,
|
any.vector-binary-instances ==0.2.5.2,
|
||||||
any.vector-stream ==0.1.0.1,
|
any.vector-stream ==0.1.0.1,
|
||||||
any.versions ==6.0.5,
|
any.versions ==6.0.4,
|
||||||
any.vty ==6.0,
|
any.vty ==6.0,
|
||||||
any.vty-crossplatform ==0.2.0.0,
|
any.vty-crossplatform ==0.2.0.0,
|
||||||
vty-crossplatform -demos,
|
vty-crossplatform -demos,
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
|
source-repository-package
|
||||||
|
type: git
|
||||||
|
location: https://github.com/hasufell/versions.git
|
||||||
|
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ constraints: any.Cabal ==3.6.3.0,
|
|||||||
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
||||||
any.vector-binary-instances ==0.2.5.2,
|
any.vector-binary-instances ==0.2.5.2,
|
||||||
any.vector-stream ==0.1.0.1,
|
any.vector-stream ==0.1.0.1,
|
||||||
any.versions ==6.0.5,
|
any.versions ==6.0.4,
|
||||||
any.vty ==6.0,
|
any.vty ==6.0,
|
||||||
any.vty-crossplatform ==0.2.0.0,
|
any.vty-crossplatform ==0.2.0.0,
|
||||||
vty-crossplatform -demos,
|
vty-crossplatform -demos,
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
|
source-repository-package
|
||||||
|
type: git
|
||||||
|
location: https://github.com/hasufell/versions.git
|
||||||
|
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ constraints: any.Cabal ==3.6.3.0,
|
|||||||
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
||||||
any.vector-binary-instances ==0.2.5.2,
|
any.vector-binary-instances ==0.2.5.2,
|
||||||
any.vector-stream ==0.1.0.1,
|
any.vector-stream ==0.1.0.1,
|
||||||
any.versions ==6.0.5,
|
any.versions ==6.0.4,
|
||||||
any.vty ==6.0,
|
any.vty ==6.0,
|
||||||
any.vty-crossplatform ==0.2.0.0,
|
any.vty-crossplatform ==0.2.0.0,
|
||||||
vty-crossplatform -demos,
|
vty-crossplatform -demos,
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
|
source-repository-package
|
||||||
|
type: git
|
||||||
|
location: https://github.com/hasufell/versions.git
|
||||||
|
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ constraints: any.Cabal ==3.6.3.0 || ==3.8.1.0,
|
|||||||
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
|
||||||
any.vector-binary-instances ==0.2.5.2,
|
any.vector-binary-instances ==0.2.5.2,
|
||||||
any.vector-stream ==0.1.0.1,
|
any.vector-stream ==0.1.0.1,
|
||||||
any.versions ==6.0.5,
|
any.versions ==6.0.4,
|
||||||
any.vty ==6.0,
|
any.vty ==6.0,
|
||||||
any.vty-crossplatform ==0.2.0.0,
|
any.vty-crossplatform ==0.2.0.0,
|
||||||
vty-crossplatform -demos,
|
vty-crossplatform -demos,
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
|
source-repository-package
|
||||||
|
type: git
|
||||||
|
location: https://github.com/hasufell/versions.git
|
||||||
|
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|
||||||
|
|||||||
@@ -56,5 +56,10 @@ source-repository-package
|
|||||||
location: https://github.com/hasufell/uri-bytestring.git
|
location: https://github.com/hasufell/uri-bytestring.git
|
||||||
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
tag: 4fb5ed14b500c192e6e7a97f6b2b1eb478806001
|
||||||
|
|
||||||
|
source-repository-package
|
||||||
|
type: git
|
||||||
|
location: https://github.com/hasufell/versions.git
|
||||||
|
tag: 79e18fbc44fae3064d8957c550cc0229465db320
|
||||||
|
|
||||||
allow-newer: cabal-install-parsers:tar
|
allow-newer: cabal-install-parsers:tar
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ common app-common-depends
|
|||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, utf8-string ^>=1.0
|
, utf8-string ^>=1.0
|
||||||
, vector >=0.12 && <0.14
|
, vector >=0.12 && <0.14
|
||||||
, versions >=6.0.5 && <6.1
|
, versions >=6.0.3 && <6.1
|
||||||
, yaml-streamly ^>=0.12.0
|
, yaml-streamly ^>=0.12.0
|
||||||
|
|
||||||
if flag(tar)
|
if flag(tar)
|
||||||
@@ -212,7 +212,7 @@ library
|
|||||||
, unordered-containers ^>=0.2.10.0
|
, unordered-containers ^>=0.2.10.0
|
||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, vector >=0.12 && <0.14
|
, vector >=0.12 && <0.14
|
||||||
, versions >=6.0.5 && <6.1
|
, versions >=6.0.3 && <6.1
|
||||||
, word8 ^>=0.1.3
|
, word8 ^>=0.1.3
|
||||||
, yaml-streamly ^>=0.12.0
|
, yaml-streamly ^>=0.12.0
|
||||||
, zlib ^>=0.6.2.2
|
, zlib ^>=0.6.2.2
|
||||||
@@ -408,7 +408,7 @@ test-suite ghcup-test
|
|||||||
, text ^>=2.0
|
, text ^>=2.0
|
||||||
, time >=1.9.3 && <1.12
|
, time >=1.9.3 && <1.12
|
||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, versions >=6.0.5 && <6.1
|
, versions >=6.0.3 && <6.1
|
||||||
|
|
||||||
if os(windows)
|
if os(windows)
|
||||||
cpp-options: -DIS_WINDOWS
|
cpp-options: -DIS_WINDOWS
|
||||||
|
|||||||
Reference in New Issue
Block a user