diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-10-03 14:32:44 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-10-03 14:32:44 +0530 |
| commit | c3eb868c3873af2fc556525350bde6faebbd7cc8 (patch) | |
| tree | b289076a0ef9872221ef1a79399aa93236cf2a7b /lib/Daffm/View.hs | |
| parent | f820f302130445d8b983ab89746f6de7443c0bea (diff) | |
| download | daffm-c3eb868c3873af2fc556525350bde6faebbd7cc8.tar.gz daffm-c3eb868c3873af2fc556525350bde6faebbd7cc8.zip | |
Add "press key to continue" with !! prefix
Diffstat (limited to '')
| -rw-r--r-- | lib/Daffm/View.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Daffm/View.hs b/lib/Daffm/View.hs index 2bfb7dc..3066c93 100644 --- a/lib/Daffm/View.hs +++ b/lib/Daffm/View.hs @@ -11,22 +11,23 @@ import qualified Data.Vector as Vec import Text.Printf (printf) appView :: AppState -> [Widget FocusTarget] -appView appState@(AppState {stateFiles, stateCwd}) = [ui] +appView appState@(AppState {stateFiles}) = [ui] where - ui :: Widget FocusTarget ui = vBox [vLimit 1 header, box, vLimit 1 cmdline] - header = str stateCwd + header = headerView appState cmdline = cmdlineView appState - box :: Widget FocusTarget box = L.renderList fileItemView True stateFiles hFixed :: Int -> Widget n -> Widget n hFixed w = hLimit w . padRight Max +headerView :: AppState -> Widget n +headerView (AppState {stateCwd}) = str stateCwd + fileItemView :: Bool -> FileInfo -> Widget FocusTarget fileItemView sel fileInfo@(FileInfo {fileSize, fileType}) = hBox - [ hFixed 5 (fileTypeView fileType), + [ hFixed 6 (fileTypeView fileType), hFixed 7 (fileSizeView fileSize), fileNameView sel fileInfo ] |
