hledger-ui
Safe HaskellNone
LanguageGHC2021

Hledger.UI.UIUtils

Description

Rendering & misc. helpers.

Synopsis

Documentation

borderDepthStr :: Maybe Int -> Widget Name Source #

borderKeysStr :: [(String, String)] -> Widget Name Source #

borderKeysStr' :: [(String, Widget Name)] -> Widget Name Source #

borderPeriodStr :: String -> Period -> Widget Name Source #

borderQueryStr :: String -> Widget Name Source #

defaultLayout :: Widget Name -> Widget Name -> Widget Name -> Widget Name Source #

Wrap a widget in the default hledger-ui screen layout.

helpDialog :: Widget Name Source #

Draw the help dialog, called when help mode is active.

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

Event handler used when help mode is active. May invoke $PAGER, less, man or info, which is likely to fail on MS Windows, TODO.

minibuffer :: Text -> Editor String Name -> Widget Name Source #

Draw the minibuffer with the given label.

moveUpEvents :: [Event] Source #

normaliseMovementKeys :: Event -> Event Source #

renderToggle :: Bool -> String -> String -> Widget Name Source #

Show both states of a toggle ("aaa/bbb"), highlighting the active one.

renderToggle1 :: Bool -> String -> Widget Name Source #

Show a toggle's label, highlighted (bold) when the toggle is active.

replaceHiddenAccountsNameWith :: AccountName -> AccountName -> AccountName Source #

Replace the special account names "*" and "..." (from balance reports with depth limit 0) to something clearer.

scrollSelectionToMiddle :: List Name item -> EventM Name UIState () Source #

Scroll a list's viewport so that the selected item is centered in the middle of the display area.

put' :: UIState -> EventM Name UIState () Source #

modify' :: (UIState -> UIState) -> EventM Name UIState () Source #

suspend :: Ord a => s -> EventM a s () Source #

On posix platforms, suspend the program using the STOP signal, like control-z in bash, returning to the original shell prompt, and when resumed, continue where we left off. On windows, does nothing.

redraw :: EventM a s () Source #

Tell vty to redraw the whole screen.

reportSpecAddQuery :: Query -> ReportSpec -> ReportSpec Source #

Restrict the ReportSpec's query by adding the given additional query.

reportSpecSetFutureAndForecast :: Maybe DateSpan -> ReportSpec -> ReportSpec Source #

Update the ReportSpec's query to exclude future transactions (later than its "today" date) and forecast transactions (generated by --forecast), if the given forecast DateSpan is Nothing, and include them otherwise.

listScrollPushingSelection :: Name -> Int -> Int -> EventM Name (List Name item) (GenericList Name Vector item) Source #

dbgui :: String -> a -> a Source #

A debug logging helper for hledger-ui code: at any debug level >= 1, logs the string to hledger-ui.log before returning the second argument. Uses unsafePerformIO.

dbguiIO :: String -> IO () Source #

Like dbgui, but convenient to use in IO.

dbguiEv :: String -> EventM Name s () Source #

Like dbgui, but convenient to use in EventM handlers.

dbguiScreensEv :: String -> (Screen -> String) -> UIState -> EventM Name UIState () Source #

Like dbguiEv, but log a compact view of the current screen stack. See showScreenStack. To just log the stack: dbguiScreensEv "" showScreenId ui

mapScreens :: (Screen -> a) -> UIState -> [a] Source #

Run a function on each screen in a UIState's screen "stack", from topmost screen down to currently-viewed screen.

uiNumBlankItems :: Int Source #

How many blank items to add to lists to fill the full window height.

showScreenStack :: String -> (Screen -> String) -> UIState -> String Source #

sendVtyEvents :: [Event] -> EventM n s () Source #