cursor-dirforest-brick (empty) → 0.0.0.0
raw patch · 3 files changed · show whitespace changes · browse cursor-dirforest-brick-0.0.0.0
+84/−0 lines, 3 filesdep +basedep +brickdep +cursorsetup-changed
Dependencies added: base, brick, cursor, cursor-brick, cursor-dirforest
Files
- Setup.hs +2/−0
- cursor-dirforest-brick.cabal +34/−0
- src/Cursor/DirForest/Brick.hs +48/−0
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ cursor-dirforest-brick.cabal view
@@ -0,0 +1,34 @@+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.38.3.+--+-- see: https://github.com/sol/hpack+--+-- hash: 1d5ff458f0796c24a23e0d98a4d8ae6bfa02d42acdb4e7d015e6621445219659++name: cursor-dirforest-brick+version: 0.0.0.0+synopsis: Brick widgets for cursors for typed directory forests+homepage: https://github.com/NorfairKing/cursor-dirforest#readme+bug-reports: https://github.com/NorfairKing/cursor-dirforest/issues+license: MIT+build-type: Simple++source-repository head+ type: git+ location: https://github.com/NorfairKing/cursor-dirforest++library+ exposed-modules:+ Cursor.DirForest.Brick+ other-modules:+ Paths_cursor_dirforest_brick+ hs-source-dirs:+ src+ build-depends:+ base >=4.7 && <5+ , brick+ , cursor+ , cursor-brick+ , cursor-dirforest+ default-language: Haskell2010
+ src/Cursor/DirForest/Brick.hs view
@@ -0,0 +1,48 @@+{-# LANGUAGE ScopedTypeVariables #-}++module Cursor.DirForest.Brick+ ( verticalPaddedDirForestCursorWidget,+ verticalDirForestCursorWidget,+ dirForestCursorWidget,+ )+where++import Brick.Types+import Brick.Widgets.Core+import Cursor.Brick.Forest+import Cursor.DirForest+import Cursor.Forest+import Cursor.Tree++verticalPaddedDirForestCursorWidget ::+ (FileOrDirCursor a -> Widget n) ->+ (FileOrDir b -> Widget n) ->+ Int ->+ DirForestCursor a b ->+ Widget n+verticalPaddedDirForestCursorWidget goA goB padding =+ verticalPaddedForestCursorWidget goA goB padding . dirForestCursorForestCursor++verticalDirForestCursorWidget ::+ (CTree (FileOrDir b) -> Widget n) ->+ (TreeCursor (FileOrDirCursor a) (FileOrDir b) -> Widget n) ->+ (CTree (FileOrDir b) -> Widget n) ->+ DirForestCursor a b ->+ Widget n+verticalDirForestCursorWidget beforeFunc currentFunc afterFunc = dirForestCursorWidget $ \befores current afters ->+ vBox $+ concat+ [ map beforeFunc befores,+ [currentFunc current],+ map afterFunc afters+ ]++dirForestCursorWidget ::+ ( [CTree (FileOrDir b)] ->+ TreeCursor (FileOrDirCursor a) (FileOrDir b) ->+ [CTree (FileOrDir b)] ->+ Widget n+ ) ->+ DirForestCursor a b ->+ Widget n+dirForestCursorWidget = foldDirForestCursor