| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Hledger.UI.UIUtils
Description
Rendering & misc. helpers.
Synopsis
- borderDepthStr :: Maybe Int -> Widget Name
- borderKeysStr :: [(String, String)] -> Widget Name
- borderKeysStr' :: [(String, Widget Name)] -> Widget Name
- borderPeriodStr :: String -> Period -> Widget Name
- borderQueryStr :: String -> Widget Name
- defaultLayout :: Widget Name -> Widget Name -> Widget Name -> Widget Name
- helpDialog :: Widget Name
- helpHandle :: BrickEvent Name AppEvent -> EventM Name UIState ()
- minibuffer :: Text -> Editor String Name -> Widget Name
- moveDownEvents :: [Event]
- moveLeftEvents :: [Event]
- moveRightEvents :: [Event]
- moveUpEvents :: [Event]
- normaliseMovementKeys :: Event -> Event
- renderToggle :: Bool -> String -> String -> Widget Name
- renderToggle1 :: Bool -> String -> Widget Name
- replaceHiddenAccountsNameWith :: AccountName -> AccountName -> AccountName
- scrollSelectionToMiddle :: List Name item -> EventM Name UIState ()
- get' :: EventM Name UIState UIState
- put' :: UIState -> EventM Name UIState ()
- modify' :: (UIState -> UIState) -> EventM Name UIState ()
- suspend :: Ord a => s -> EventM a s ()
- redraw :: EventM a s ()
- reportSpecAddQuery :: Query -> ReportSpec -> ReportSpec
- reportSpecSetFutureAndForecast :: Maybe DateSpan -> ReportSpec -> ReportSpec
- listScrollPushingSelection :: Name -> Int -> Int -> EventM Name (List Name item) (GenericList Name Vector item)
- dbgui :: String -> a -> a
- dbguiIO :: String -> IO ()
- dbguiEv :: String -> EventM Name s ()
- dbguiScreensEv :: String -> (Screen -> String) -> UIState -> EventM Name UIState ()
- showScreenId :: Screen -> String
- showScreenRegisterDescriptions :: Screen -> String
- showScreenSelection :: Screen -> String
- mapScreens :: (Screen -> a) -> UIState -> [a]
- uiNumBlankItems :: Int
- showScreenStack :: String -> (Screen -> String) -> UIState -> String
- sendVtyEvents :: [Event] -> EventM n s ()
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.
moveDownEvents :: [Event] Source #
moveLeftEvents :: [Event] Source #
moveRightEvents :: [Event] Source #
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.
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.
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.
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
showScreenId :: Screen -> String Source #
showScreenRegisterDescriptions :: Screen -> String Source #
showScreenSelection :: Screen -> String Source #
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 #