Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Extensions |
|
Mixed tabular list is a list with different kinds of rows.
Each row belongs to a row kind which is usually a data constructor of row data type. Because there can be more than one data constructor in row data type, this list is called mixed tabular list. Each row kind can have a different number of columns than another row kind.
Cell by cell navigation is not supported. You can navigate row by row.
Because this list is designed to show every column in the available space, horizontal scrolling is not supported.
Synopsis
- data MixedContext = MixedContext {
- row :: FlatContext
- col :: Index
- data MixedColHdr n w = MixedColHdr {}
- data MixedRenderers n e w r = MixedRenderers {
- drawCell :: ListFocused -> MixedContext -> e -> Widget n
- rowHdr :: Maybe (RowHdr n e r)
- colHdr :: Maybe (MixedColHdr n w)
- drawColHdrRowHdr :: DrawColHdrRowHdr n
- type CalcWidthsPerRowKind e w = AvailWidth -> [e] -> w
- type WidthsPerRow e w = w -> e -> [Width]
- data MixedTabularList n e w = MixedTabularList {
- list :: GenericList n Seq e
- calcWidthsPerRowKind :: CalcWidthsPerRowKind e w
- widthsPerRow :: WidthsPerRow e w
- mixedTabularList :: n -> Seq e -> ListItemHeight -> CalcWidthsPerRowKind e w -> WidthsPerRow e w -> MixedTabularList n e w
- renderMixedTabularList :: (Show n, Ord n) => MixedRenderers n e w r -> ListFocused -> MixedTabularList n e w -> Widget n
- handleMixedListEvent :: Ord n => Event -> EventM n (MixedTabularList n e w) ()
- handleMixedListEventVi :: Ord n => Event -> EventM n (MixedTabularList n e w) ()
- module Brick.Widgets.TabularList.Types
Data types
data MixedContext Source #
Context for mixed columns
MixedContext | |
|
data MixedColHdr n w Source #
Mixed column header
Instances
Generic (MixedColHdr n w) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedColHdr n w) :: Type -> Type # from :: MixedColHdr n w -> Rep (MixedColHdr n w) x # to :: Rep (MixedColHdr n w) x -> MixedColHdr n w # | |
type Rep (MixedColHdr n w) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedColHdr n w) = D1 ('MetaData "MixedColHdr" "Brick.Widgets.TabularList.Mixed" "brick-tabular-list-1.0.0.1-En9LBR6wT7ZEawsXqx3s8t" 'False) (C1 ('MetaCons "MixedColHdr" 'PrefixI 'True) (S1 ('MetaSel ('Just "draw") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListFocused -> Index -> Widget n)) :*: (S1 ('MetaSel ('Just "widths") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (w -> [Width])) :*: S1 ('MetaSel ('Just "height") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Height)))) |
data MixedRenderers n e w r Source #
Rendering functions for components of mixed tabular list
MixedRenderers | |
|
Instances
type CalcWidthsPerRowKind e w = AvailWidth -> [e] -> w Source #
Calculate widths per row kind from visible list rows and the width available after row header.
type WidthsPerRow e w = w -> e -> [Width] Source #
It is a function to get widths for each row. Use pattern matching to detect the kind of each row. Usually, a row kind is a data constructor of row data type.
data MixedTabularList n e w Source #
MixedTabularList | |
|
Instances
Generic (MixedTabularList n e w) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedTabularList n e w) :: Type -> Type # from :: MixedTabularList n e w -> Rep (MixedTabularList n e w) x # to :: Rep (MixedTabularList n e w) x -> MixedTabularList n e w # | |
type Rep (MixedTabularList n e w) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedTabularList n e w) = D1 ('MetaData "MixedTabularList" "Brick.Widgets.TabularList.Mixed" "brick-tabular-list-1.0.0.1-En9LBR6wT7ZEawsXqx3s8t" 'False) (C1 ('MetaCons "MixedTabularList" 'PrefixI 'True) (S1 ('MetaSel ('Just "list") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (GenericList n Seq e)) :*: (S1 ('MetaSel ('Just "calcWidthsPerRowKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CalcWidthsPerRowKind e w)) :*: S1 ('MetaSel ('Just "widthsPerRow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WidthsPerRow e w))))) |
List construction
:: n | The name of the list. It must be unique. |
-> Seq e | The initial list elements |
-> ListItemHeight | |
-> CalcWidthsPerRowKind e w | |
-> WidthsPerRow e w | |
-> MixedTabularList n e w |
Create a mixed tabular list.
Rendering
renderMixedTabularList Source #
:: (Show n, Ord n) | |
=> MixedRenderers n e w r | Renderers |
-> ListFocused | |
-> MixedTabularList n e w | The list |
-> Widget n |
Render mixed tabular list.
Event handlers
:: Ord n | |
=> Event | Event |
-> EventM n (MixedTabularList n e w) () |
Handle events for mixed tabular list with navigation keys. This just calls handleListEvent
.
handleMixedListEventVi Source #
:: Ord n | |
=> Event | Event |
-> EventM n (MixedTabularList n e w) () |
Handle events for mixed tabular list with vim keys. This just calls handleListEventVi
.