From 9ec2d7eb7bea625f2f2bb64d0470dfa4963d398a Mon Sep 17 00:00:00 2001 From: Jonathan Daugherty Date: Sun, 28 Jun 2015 21:28:55 -0700 Subject: [PATCH] Border: add function to build border style from a character --- programs/BorderDemo.hs | 1 + src/Brick/Widgets/Border/Style.hs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/programs/BorderDemo.hs b/programs/BorderDemo.hs index 076c261..0fc76a3 100644 --- a/programs/BorderDemo.hs +++ b/programs/BorderDemo.hs @@ -21,6 +21,7 @@ styles = , ("unicode bold", unicodeBold) , ("unicode rounded", unicodeRounded) , ("custom", custom) + , ("from 'x'", borderStyleFromChar 'x') ] custom :: BorderStyle diff --git a/src/Brick/Widgets/Border/Style.hs b/src/Brick/Widgets/Border/Style.hs index 5f465f3..9fad9ce 100644 --- a/src/Brick/Widgets/Border/Style.hs +++ b/src/Brick/Widgets/Border/Style.hs @@ -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 =