Closed hojberg closed 8 years ago
There are a couple of ways to do what you want.
If you want to left-justify:
vLimit 1 (str "TODAY (Sunday)" <+> fill ' ')
If you want to right-justify:
vLimit 1 (fill ' ' <+> str "TODAY (Sunday)")
If you want to center:
hCenter $ str "TODAY (Sunday)"
or even
hCenterWith '-' $ str "TODAY (Sunday)"
And to set the attribute (e.g. in the centering case), use withDefAttr
:
withDefAttr someAttr $ hCenter $ str "TODAY (Sunday)"
and define someAttr
to be some attribute name like
{-# LANGUAGE OverloadedStrings #-}
someAttr :: AttrName
someAttr = "headerAttr"
and then add it to the AttrMap
used by your App
value:
myAttrMap :: AttrMap
myAttrMap = attrMap defAttr
[ (someAttr, black `on` yellow)
]
app :: App s e
app = App { ..., appAttrMap = const myAttrMap }
If that helps, please close the issue (or let me know what else I can do). Thanks!
Nice! I'll check this out. Thank you so much. Didn't know about fill
Hi,
Thanks for a really cool lib.
I'm interested in sorta doing full width banners or headers. I mean full width of the viewport.
I want to do the equivalent of this
and color the background.
I know I can do this manually with spaces, but looking for a way to do it automatically to the 'edge of view' or something like that.
(Apologizes in advance, i'm new to both Brick and Haskell, but having a lot of fun so far)