2020-02-08 03:43:36 +03:00
|
|
|
{-# LANGUAGE CPP #-}
|
2017-07-07 07:47:41 +03:00
|
|
|
module Main where
|
|
|
|
|
2020-02-08 03:43:36 +03:00
|
|
|
#if !(MIN_VERSION_base(4,11,0))
|
2017-07-07 07:47:41 +03:00
|
|
|
import Data.Monoid ((<>))
|
2020-02-08 03:43:36 +03:00
|
|
|
#endif
|
2017-07-07 07:47:41 +03:00
|
|
|
import Brick
|
2017-08-05 19:20:07 +03:00
|
|
|
import Text.Wrap (defaultWrapSettings, preserveIndentation)
|
2017-07-07 07:47:41 +03:00
|
|
|
|
|
|
|
ui :: Widget ()
|
2017-08-05 19:20:07 +03:00
|
|
|
ui =
|
|
|
|
t1 <=> (padTop (Pad 1) t2)
|
|
|
|
where
|
|
|
|
t1 = strWrap $ "Hello, world! This line is long enough that " <>
|
|
|
|
"it's likely to wrap on your terminal if your window " <>
|
|
|
|
"isn't especially wide. Try narrowing and widening " <>
|
|
|
|
"the window to see what happens to this text."
|
|
|
|
settings = defaultWrapSettings { preserveIndentation = True }
|
|
|
|
t2 = strWrapWith settings $
|
|
|
|
"This text wraps\n" <>
|
|
|
|
" with different settings to preserve indentation\n" <>
|
|
|
|
" so that long lines wrap in nicer way."
|
2017-07-07 07:47:41 +03:00
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main = simpleMain ui
|