Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Mixed tabular list is a list with different kinds of rows.
Read Shared Traits of Tabular List Widgets before reading further.
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 MixedContents row cell rowH colH = MixedContents {}
- data MixedRenderers n row cell rowH colH = MixedRenderers {
- drawCell :: ListFocused -> Position -> row -> Maybe cell -> Widget n
- drawRowHdr :: Maybe (ListFocused -> WidthDeficit -> Position -> row -> Maybe rowH -> Widget n)
- drawColHdr :: Maybe (ListFocused -> ColumnIndex -> Maybe colH -> Widget n)
- drawColHdrRowHdr :: Maybe (ListFocused -> WidthDeficit -> Widget n)
- data ColSizes row = ColSizes {}
- data CalcColSizes row
- = AvailWidth (AvailWidth -> ColSizes row)
- | VisibleRows ([row] -> AvailWidth -> ColSizes row)
- data MixedSizes row rowH = MixedSizes {
- rowHdr :: Maybe (RowHeaderWidth rowH)
- colSizes :: CalcColSizes row
- data MixedTabularList n row cell rowH colH = MixedTabularList {
- list :: GenericList n Seq row
- sizes :: MixedSizes row rowH
- contents :: MixedContents row cell rowH colH
- mixedTabularList :: n -> Seq row -> ListItemHeight -> MixedSizes row rowH -> MixedContents row cell rowH colH -> MixedTabularList n row cell rowH colH
- renderMixedTabularList :: (Show n, Ord n) => MixedRenderers n row cell rowH colH -> ListFocused -> MixedTabularList n row cell rowH colH -> Widget n
- handleMixedListEvent :: Ord n => Event -> EventM n (MixedTabularList n row cell rowH colH) ()
- handleMixedListEventVi :: Ord n => Event -> EventM n (MixedTabularList n row cell rowH colH) ()
- module Brick.Widgets.TabularList.Types
Data types
data MixedContents row cell rowH colH Source #
Functions for getting contents of mixed tabular list elements. See List Type Variables.
Instances
Generic (MixedContents row cell rowH colH) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedContents row cell rowH colH) :: Type -> Type # from :: MixedContents row cell rowH colH -> Rep (MixedContents row cell rowH colH) x # to :: Rep (MixedContents row cell rowH colH) x -> MixedContents row cell rowH colH # | |
type Rep (MixedContents row cell rowH colH) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedContents row cell rowH colH) = D1 ('MetaData "MixedContents" "Brick.Widgets.TabularList.Mixed" "brick-tabular-list-0.2.0.1-2FLSyLIRGPQHgm66fO4Dwn" 'False) (C1 ('MetaCons "MixedContents" 'PrefixI 'True) (S1 ('MetaSel ('Just "cell") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (row -> ColumnIndex -> Maybe cell)) :*: (S1 ('MetaSel ('Just "rowHdr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (row -> RowIndex -> Maybe rowH))) :*: S1 ('MetaSel ('Just "colHdr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (ColumnIndex -> Maybe colH)))))) |
data MixedRenderers n row cell rowH colH Source #
Rendering functions for elements of mixed tabular list. See
MixedRenderers | |
|
Instances
Column sizes calculated after row header width is calculated. See List Type Variables.
ColSizes | |
|
Instances
Generic (ColSizes row) Source # | |
type Rep (ColSizes row) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (ColSizes row) = D1 ('MetaData "ColSizes" "Brick.Widgets.TabularList.Mixed" "brick-tabular-list-0.2.0.1-2FLSyLIRGPQHgm66fO4Dwn" 'False) (C1 ('MetaCons "ColSizes" 'PrefixI 'True) (S1 ('MetaSel ('Just "rowKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (row -> [Width])) :*: S1 ('MetaSel ('Just "colHdr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ([Width], Height))))) |
data CalcColSizes row Source #
Function for calculating column sizes. See List Type Variables.
AvailWidth (AvailWidth -> ColSizes row) | Calculate sizes with the width available after row header width is calculated. |
VisibleRows ([row] -> AvailWidth -> ColSizes row) | Calculate sizes with visible rows and the width available after row header width is calculated. |
Instances
Generic (CalcColSizes row) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (CalcColSizes row) :: Type -> Type # from :: CalcColSizes row -> Rep (CalcColSizes row) x # to :: Rep (CalcColSizes row) x -> CalcColSizes row # | |
type Rep (CalcColSizes row) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (CalcColSizes row) = D1 ('MetaData "CalcColSizes" "Brick.Widgets.TabularList.Mixed" "brick-tabular-list-0.2.0.1-2FLSyLIRGPQHgm66fO4Dwn" 'False) (C1 ('MetaCons "AvailWidth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (AvailWidth -> ColSizes row))) :+: C1 ('MetaCons "VisibleRows" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ([row] -> AvailWidth -> ColSizes row)))) |
data MixedSizes row rowH Source #
Sizes for elements of mixed tabular list. See List Type Variables.
MixedSizes | |
|
Instances
Generic (MixedSizes row rowH) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedSizes row rowH) :: Type -> Type # from :: MixedSizes row rowH -> Rep (MixedSizes row rowH) x # to :: Rep (MixedSizes row rowH) x -> MixedSizes row rowH # | |
type Rep (MixedSizes row rowH) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedSizes row rowH) = D1 ('MetaData "MixedSizes" "Brick.Widgets.TabularList.Mixed" "brick-tabular-list-0.2.0.1-2FLSyLIRGPQHgm66fO4Dwn" 'False) (C1 ('MetaCons "MixedSizes" 'PrefixI 'True) (S1 ('MetaSel ('Just "rowHdr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (RowHeaderWidth rowH))) :*: S1 ('MetaSel ('Just "colSizes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (CalcColSizes row)))) |
data MixedTabularList n row cell rowH colH Source #
See List Type Variables.
MixedTabularList | |
|
Instances
Generic (MixedTabularList n row cell rowH colH) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedTabularList n row cell rowH colH) :: Type -> Type # from :: MixedTabularList n row cell rowH colH -> Rep (MixedTabularList n row cell rowH colH) x # to :: Rep (MixedTabularList n row cell rowH colH) x -> MixedTabularList n row cell rowH colH # | |
type Rep (MixedTabularList n row cell rowH colH) Source # | |
Defined in Brick.Widgets.TabularList.Mixed type Rep (MixedTabularList n row cell rowH colH) = D1 ('MetaData "MixedTabularList" "Brick.Widgets.TabularList.Mixed" "brick-tabular-list-0.2.0.1-2FLSyLIRGPQHgm66fO4Dwn" 'False) (C1 ('MetaCons "MixedTabularList" 'PrefixI 'True) (S1 ('MetaSel ('Just "list") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (GenericList n Seq row)) :*: (S1 ('MetaSel ('Just "sizes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MixedSizes row rowH)) :*: S1 ('MetaSel ('Just "contents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MixedContents row cell rowH colH))))) |
List construction
:: n | The name of the list. It must be unique. |
-> Seq row | The initial list rows |
-> ListItemHeight | |
-> MixedSizes row rowH | |
-> MixedContents row cell rowH colH | |
-> MixedTabularList n row cell rowH colH |
Create a mixed tabular list.
Rendering
renderMixedTabularList Source #
:: (Show n, Ord n) | |
=> MixedRenderers n row cell rowH colH | Renderers |
-> ListFocused | |
-> MixedTabularList n row cell rowH colH | The list |
-> Widget n |
Render mixed tabular list
Event handlers
:: Ord n | |
=> Event | Event |
-> EventM n (MixedTabularList n row cell rowH colH) () |
Handle events for mixed tabular list with navigation keys. This just calls handleListEvent
.
handleMixedListEventVi Source #
:: Ord n | |
=> Event | Event |
-> EventM n (MixedTabularList n row cell rowH colH) () |
Handle events for mixed tabular list with vim keys. This just calls handleListEventVi
.