mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-12-04 17:36:43 +03:00
Border: add function to build border style from a character
This commit is contained in:
parent
ce54d48f42
commit
9ec2d7eb7b
@ -21,6 +21,7 @@ styles =
|
||||
, ("unicode bold", unicodeBold)
|
||||
, ("unicode rounded", unicodeRounded)
|
||||
, ("custom", custom)
|
||||
, ("from 'x'", borderStyleFromChar 'x')
|
||||
]
|
||||
|
||||
custom :: BorderStyle
|
||||
|
@ -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 =
|
||||
|
Loading…
Reference in New Issue
Block a user