hledger-ui
Safe HaskellNone
LanguageGHC2021

Hledger.UI.AccountsScreen

Synopsis

Documentation

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

Construct an accounts-like screen (all accounts, cash, balance sheet or income statement, selected by the AccountsScreenKind), listing the appropriate set of accounts, with the appropriate one selected. Screen-specific arguments: the kind of screen, and the account to select if any.

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

Update an accounts-like screen's state from these options, reporting date, and journal. The report is restricted and accumulated according to the screen's kind (_assKind).

asDrawHelper :: AccountsScreenState -> 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 :: AccountsScreenState -> 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 :: AccountsScreenState -> BrickEvent Name AppEvent -> EventM Name UIState () Source #

Handle events when in normal mode on any accounts-like screen. The provided state should be 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).