hledger-ui
Safe HaskellNone
LanguageGHC2021

Hledger.UI.AccountsScreen

Synopsis

Documentation

asNew :: UIOpts -> Day -> Journal -> Maybe AccountName -> Screen Source #

Construct an accounts screen listing the appropriate set of accounts, with the appropriate one selected. Screen-specific arguments: the account to select if any.

asUpdate :: UIOpts -> Day -> Journal -> AccountsScreenState -> AccountsScreenState Source #

Update an accounts screen's state from these options, reporting date, and journal.

asDraw :: UIState -> [Widget Name] Source #

asDrawHelper :: UIState -> ReportOpts -> String -> [Widget Name] Source #

Help draw any accounts-like screen (all accounts, balance sheet, income statement..). The provided ReportOpts are used instead of the ones in the UIState. The other argument is the screen display name.

asHandle :: BrickEvent Name AppEvent -> EventM Name UIState () Source #

Handle events on any accounts-like screen (all accounts, balance sheet, income statement..).

handleHelpMode :: BrickEvent Name AppEvent -> EventM Name UIState () Source #

Handle events when in help mode on any screen.

handleMinibufferMode :: Editor String Name -> BrickEvent n e -> EventM Name UIState () Source #

Handle events when in minibuffer mode on any screen.

asHandleNormalMode :: AccountsLikeScreen -> BrickEvent Name AppEvent -> EventM Name UIState () Source #

Handle events when in normal mode on any accounts-like screen. The provided AccountsLikeScreen should correspond to the ui state's current screen.

enterRegisterScreen :: Day -> AccountName -> UIState -> EventM Name UIState () Source #

asSetSelectedAccount :: AccountName -> Screen -> Screen Source #

Set the selected account on any of the accounts screens. Has no effect on other screens. Sets the high-level property _assSelectedAccount and also selects the corresponding or best alternative item in the list widget (_assList).