purebred-0.1.0.0: An mail user agent built around notmuch

Safe HaskellNone
LanguageHaskell2010

UI.App

Contents

Synopsis

Synopsis

This module ties in all functions for rendering and handling events.

Differences to Brick

Purebred uses Brick widgets, but in order to make Purebred configurable, we've made changes to how we use Brick. The single difference to Brick is found on how we process keys (see Keybindings). Brick handles keys directly in the widget. Purebred instead looks up keybindings first. If nothing matches, the key is forwarded to the widget.

drawUI :: AppState -> [Widget Name] Source #

Main UI drawing function. Looks up which widgets need to be rendered in the current View and traverses each layer pattern matching the ViewName and widget Name in renderWidget to draw the widget.

handleViewEvent :: ViewName -> Name -> AppState -> Event -> EventM Name (Next AppState) Source #

Main event handler

appEvent Source #

Arguments

:: AppState 
-> BrickEvent Name PurebredEvent

event

-> EventM Name (Next AppState) 

Handling of application events. These can be keys which are pressed by the user or asynchronous events send by threads.

theApp Source #

Arguments

:: AppState

initial state

-> App AppState PurebredEvent Name 

Application event loop.