{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# OPTIONS_HADDOCK show-extensions #-}
module Brick.Widgets.TabularList.Types (
Index
, Width
, Height
, AvailWidth
, ListItemHeight
, FlatContext(..)
, WidthDeficit
, ListFocused
, Selected
, RowHdr(..)
, DrawColHdrRowHdr
) where
import GHC.Generics (Generic)
import Brick.Types
type Index = Int
type Width = Int
type Height = Int
type AvailWidth = Int
type ListItemHeight = Int
data FlatContext = FlatContext {
FlatContext -> Index
index :: Index
, FlatContext -> Bool
selected :: Bool
} deriving (Index -> FlatContext -> ShowS
[FlatContext] -> ShowS
FlatContext -> String
forall a.
(Index -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FlatContext] -> ShowS
$cshowList :: [FlatContext] -> ShowS
show :: FlatContext -> String
$cshow :: FlatContext -> String
showsPrec :: Index -> FlatContext -> ShowS
$cshowsPrec :: Index -> FlatContext -> ShowS
Show, forall x. Rep FlatContext x -> FlatContext
forall x. FlatContext -> Rep FlatContext x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FlatContext x -> FlatContext
$cfrom :: forall x. FlatContext -> Rep FlatContext x
Generic)
type WidthDeficit = Int
type ListFocused = Bool
type Selected = Bool
data RowHdr n e r = RowHdr {
forall n e r.
RowHdr n e r -> Bool -> Index -> Bool -> r -> Widget n
draw :: ListFocused -> WidthDeficit -> Selected -> r -> Widget n
, forall n e r. RowHdr n e r -> Index -> [r] -> Index
width :: AvailWidth -> [r] -> Width
, forall n e r. RowHdr n e r -> e -> Index -> r
toRowHdr :: e -> Index -> r
} deriving forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall n e r x. Rep (RowHdr n e r) x -> RowHdr n e r
forall n e r x. RowHdr n e r -> Rep (RowHdr n e r) x
$cto :: forall n e r x. Rep (RowHdr n e r) x -> RowHdr n e r
$cfrom :: forall n e r x. RowHdr n e r -> Rep (RowHdr n e r) x
Generic
type DrawColHdrRowHdr n = Maybe (ListFocused -> WidthDeficit -> Widget n)