{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
module Brick.Widgets.Border.Style
( BorderStyle(..)
, borderStyleFromChar
, ascii
, unicode
, unicodeBold
, unicodeRounded
, defaultBorderStyle
)
where
import GHC.Generics
import Control.DeepSeq
data BorderStyle =
BorderStyle { bsCornerTL :: Char
, bsCornerTR :: Char
, bsCornerBR :: Char
, bsCornerBL :: Char
, bsIntersectFull :: Char
, bsIntersectL :: Char
, bsIntersectR :: Char
, bsIntersectT :: Char
, bsIntersectB :: Char
, bsHorizontal :: Char
, bsVertical :: Char
}
deriving (Show, Read, Eq, Generic, NFData)
defaultBorderStyle :: BorderStyle
defaultBorderStyle = unicode
borderStyleFromChar :: Char -> BorderStyle
borderStyleFromChar c =
BorderStyle c c c c c c c c c c c
ascii :: BorderStyle
ascii =
BorderStyle { bsCornerTL = '+'
, bsCornerTR = '+'
, bsCornerBR = '+'
, bsCornerBL = '+'
, bsIntersectFull = '+'
, bsIntersectL = '+'
, bsIntersectR = '+'
, bsIntersectT = '+'
, bsIntersectB = '+'
, bsHorizontal = '-'
, bsVertical = '|'
}
unicode :: BorderStyle
unicode =
BorderStyle { bsCornerTL = '┌'
, bsCornerTR = '┐'
, bsCornerBR = '┘'
, bsCornerBL = '└'
, bsIntersectFull = '┼'
, bsIntersectL = '├'
, bsIntersectR = '┤'
, bsIntersectT = '┬'
, bsIntersectB = '┴'
, bsHorizontal = '─'
, bsVertical = '│'
}
unicodeBold :: BorderStyle
unicodeBold =
BorderStyle { bsCornerTL = '┏'
, bsCornerTR = '┓'
, bsCornerBR = '┛'
, bsCornerBL = '┗'
, bsIntersectFull = '╋'
, bsIntersectL = '┣'
, bsIntersectR = '┫'
, bsIntersectT = '┳'
, bsIntersectB = '┻'
, bsHorizontal = '━'
, bsVertical = '┃'
}
unicodeRounded :: BorderStyle
unicodeRounded =
BorderStyle { bsCornerTL = '╭'
, bsCornerTR = '╮'
, bsCornerBR = '╯'
, bsCornerBL = '╰'
, bsIntersectFull = '┼'
, bsIntersectL = '├'
, bsIntersectR = '┤'
, bsIntersectT = '┬'
, bsIntersectB = '┴'
, bsHorizontal = '─'
, bsVertical = '│'
}