module Mensam.Client.UI.Brick.AttrMap where

import Brick
import Brick.Forms
import Brick.Widgets.List
import Graphics.Vty

attrDefault :: Attr
attrDefault :: Attr
attrDefault =
  Attr
    { attrStyle :: MaybeDefault Style
attrStyle = MaybeDefault Style
forall v. MaybeDefault v
Default
    , attrForeColor :: MaybeDefault Color
attrForeColor = Color -> MaybeDefault Color
forall v. v -> MaybeDefault v
SetTo Color
brightWhite
    , attrBackColor :: MaybeDefault Color
attrBackColor = Color -> MaybeDefault Color
forall v. v -> MaybeDefault v
SetTo Color
black
    , attrURL :: MaybeDefault Text
attrURL = MaybeDefault Text
forall v. MaybeDefault v
Default
    }

attrsDefault :: AttrMap
attrsDefault :: AttrMap
attrsDefault =
  Attr -> [(AttrName, Attr)] -> AttrMap
attrMap
    Attr
attrDefault
    [ (AttrName
formAttr, Attr
attrDefault)
    , (AttrName
focusedFormInputAttr, Attr
attrDefault {attrBackColor = SetTo brightBlack})
    , (AttrName
invalidFormInputAttr, Attr
attrDefault {attrForeColor = SetTo brightRed})
    , (AttrName
listAttr, Attr
attrDefault)
    , (AttrName
listSelectedAttr, Attr
attrDefault Attr -> Style -> Attr
`withStyle` Style
standout)
    ]

attrBackground :: Attr
attrBackground :: Attr
attrBackground =
  Attr
attrDefault
    { attrForeColor = SetTo white
    , attrBackColor = SetTo black
    }

attrsBackground :: AttrMap
attrsBackground :: AttrMap
attrsBackground =
  Attr -> [(AttrName, Attr)] -> AttrMap
attrMap
    Attr
attrBackground
    [ (AttrName
formAttr, Attr
attrBackground)
    , (AttrName
focusedFormInputAttr, Attr
attrBackground {attrBackColor = SetTo brightBlack})
    , (AttrName
invalidFormInputAttr, Attr
attrBackground {attrForeColor = SetTo brightRed})
    , (AttrName
listAttr, Attr
attrBackground)
    , (AttrName
listSelectedAttr, Attr
attrBackground Attr -> Style -> Attr
`withStyle` Style
standout)
    ]

attrForeground :: Attr
attrForeground :: Attr
attrForeground =
  Attr
attrDefault
    { attrForeColor = SetTo brightBlack
    , attrBackColor = SetTo brightWhite
    }

attrsForeground :: AttrMap
attrsForeground :: AttrMap
attrsForeground =
  Attr -> [(AttrName, Attr)] -> AttrMap
attrMap
    Attr
attrForeground
    [ (AttrName
formAttr, Attr
attrForeground)
    , (AttrName
focusedFormInputAttr, Attr
attrForeground {attrBackColor = SetTo brightBlack})
    , (AttrName
invalidFormInputAttr, Attr
attrForeground {attrForeColor = SetTo brightRed})
    , (AttrName
listAttr, Attr
attrForeground)
    , (AttrName
listSelectedAttr, Attr
attrForeground Attr -> Style -> Attr
`withStyle` Style
standout)
    ]