aboutsummaryrefslogtreecommitdiff
path: root/lib/Daffm/View.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Daffm/View.hs')
-rw-r--r--lib/Daffm/View.hs11
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
]