hum-0.2.0.0: A TUI MPD client, inspired by ncmpcpp
Copyright(c) Itai Y. Efrat 2020-2021
LicenseGPLv2-or-later (see LICENSE)
MaintainerItai Y. Efrat <itai3397@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Hum.UI

Description

The starting point of Hum's logic. Contains things like building the initial state, shared keypresses, and the UI drawing function.

Synopsis

Documentation

app :: App HumState HumEvent Name Source #

The brick app record for Hum.

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

Draws shared UI elements and dispatches for view specific ones.

chooseCursor :: HumState -> [CursorLocation Name] -> Maybe (CursorLocation Name) Source #

Make sure cursor is displayed when editing text.

buildInitialState :: BChan HumEvent -> IO HumState Source #

builds 'HumState for the first time. A lot of overlap with functions from | Hum.Rebuild, but they are hard to reuse because HumState is strict.

handleEvent :: HumState -> BrickEvent Name HumEvent -> EventM Name (Next HumState) Source #

handles keypresses shared between views, and nonkeypress events from the channels (ticks every 0.1 seconds and mpd events). Dispatches for view specific keypresses.