Border: add function to build border style from a character

This commit is contained in:
Jonathan Daugherty 2015-06-28 21:28:55 -07:00
parent ce54d48f42
commit 9ec2d7eb7b
2 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,7 @@ styles =
, ("unicode bold", unicodeBold)
, ("unicode rounded", unicodeRounded)
, ("custom", custom)
, ("from 'x'", borderStyleFromChar 'x')
]
custom :: BorderStyle

View File

@ -1,6 +1,7 @@
{-# LANGUAGE OverloadedStrings #-}
module Brick.Widgets.Border.Style
( BorderStyle(..)
, borderStyleFromChar
, ascii
, unicode
, unicodeBold
@ -40,6 +41,11 @@ data BorderStyle =
instance Default BorderStyle where
def = ascii
-- | Make a border style using the specified character everywhere.
borderStyleFromChar :: Char -> BorderStyle
borderStyleFromChar c =
BorderStyle c c c c c c c c c c c
-- |An ASCII border style which will work in any terminal.
ascii :: BorderStyle
ascii =