Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data FileTree a
- data FileContext a
- flagged :: FileContext a -> Bool
- val :: FileContext a -> a
- path :: FileContext a -> FilePath
- name :: FileContext a -> String
- kind :: FileContext a -> FileKind
- newFileTree :: ValueLoader a -> FilePath -> IO (FileTree a)
- moveUp :: FileTree a -> EventM String (FileTree a)
- moveDown :: FileTree a -> EventM String (FileTree a)
- pageUp :: FileTree a -> EventM String (FileTree a)
- pageDown :: FileTree a -> EventM String (FileTree a)
- moveToTop :: FileTree a -> EventM String (FileTree a)
- moveToBottom :: FileTree a -> EventM String (FileTree a)
- ascendDir :: FileTree a -> EventM String (FileTree a)
- descendDir :: FileTree a -> EventM String (FileTree a)
- toggleFlagged :: FileTree a -> EventM String (FileTree a)
- toggleFlaggedVisible :: FileTree a -> FileTree a
- getCurrentFilePath :: FileTree a -> Maybe FilePath
- getCurrentDir :: FileTree a -> FilePath
- getFlagged :: FileTree a -> [FilePath]
- renderFileTree :: FileTree a -> Widget String
- renderFileTreeCustom :: CustomFCRender a -> FileTree a -> Widget String
- renderFileContext :: FileContext a -> Widget String
- flaggedItemAttr :: AttrName
- titleAttr :: AttrName
- dirAttr :: AttrName
- fileAttr :: AttrName
- errorAttr :: AttrName
Types
data FileContext a Source #
flagged :: FileContext a -> Bool Source #
val :: FileContext a -> a Source #
path :: FileContext a -> FilePath Source #
name :: FileContext a -> String Source #
kind :: FileContext a -> FileKind Source #
newFileTree :: ValueLoader a -> FilePath -> IO (FileTree a) Source #
Create a new FileTree
situated at the given FilePath
The given ValueLoader
will be used to load additional context for each
filepath (dirs AND files). It will be called lazily using unsafeInterleaveIO
when the value itself is accessed (if ever).
Interaction
moveToTop :: FileTree a -> EventM String (FileTree a) Source #
Move the cursor the the top of the file list
moveToBottom :: FileTree a -> EventM String (FileTree a) Source #
Move the cursor the the bottom of the file list
ascendDir :: FileTree a -> EventM String (FileTree a) Source #
Move the cursor up a directory in the file tree
descendDir :: FileTree a -> EventM String (FileTree a) Source #
If the cursor is on a directory then descend the cursor into that dir If the cursor is on a file nothing happens
toggleFlagged :: FileTree a -> EventM String (FileTree a) Source #
Flag or unflag the current file or dir
toggleFlaggedVisible :: FileTree a -> FileTree a Source #
Hide/Show a list of all flagged files
Queries
getCurrentFilePath :: FileTree a -> Maybe FilePath Source #
Get the absolute path of the object (dir or file) under the cursor
getCurrentDir :: FileTree a -> FilePath Source #
Get the absolute path of the directory where the cursor currently is.
getFlagged :: FileTree a -> [FilePath] Source #
Get all flagged file paths. All paths are absolute
Rendering
renderFileContext :: FileContext a -> Widget String Source #
Attributes
flaggedItemAttr :: AttrName Source #
Flagged items are rendered with this attr