File: CashScreen.hs

package info (click to toggle)
haskell-hledger-ui 1.32.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 420 kB
  • sloc: haskell: 2,443; makefile: 5
file content (29 lines) | stat: -rw-r--r-- 754 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- The cash accounts screen, like the accounts screen but restricted to cash accounts.

module Hledger.UI.CashScreen
 (csNew
 ,csUpdate
 ,csDraw
 ,csHandle
 )
where

import Brick

import Hledger
import Hledger.Cli hiding (mode, progname, prognameandversion)
import Hledger.UI.UIOptions
import Hledger.UI.UITypes
import Hledger.UI.UIUtils
import Hledger.UI.UIScreens
import Hledger.UI.AccountsScreen (asHandle, asDrawHelper)


csDraw :: UIState -> [Widget Name]
csDraw ui = dbgui "csDraw" $ asDrawHelper ui ropts' scrname
  where
    scrname = "cash balances"
    ropts' = (_rsReportOpts $ reportspec_ $ uoCliOpts $ aopts ui){balanceaccum_=Historical}

csHandle :: BrickEvent Name AppEvent -> EventM Name UIState ()
csHandle = asHandle . dbgui "csHandle"