PaddingDemo: use explicit imports

This commit is contained in:
Jonathan Daugherty 2015-07-10 13:30:34 -07:00
parent 9fce0120b0
commit d1f8cd9a67

View File

@ -2,36 +2,48 @@
module Main where module Main where
import Data.Default import Data.Default
import Graphics.Vty import qualified Graphics.Vty as V
import Brick.Main import Brick.Main (App(..), neverShowCursor, resizeOrQuit, defaultMain)
import Brick.Widgets.Core import Brick.Widgets.Core
import Brick.Widgets.Border ( Widget
import Brick.Widgets.Center , vBox
, hBox
, Padding(..)
, padAll
, padLeft
, padRight
, padTop
, padBottom
, padTopBottom
, padLeftRight
)
import Brick.Widgets.Border as B
import Brick.Widgets.Center as C
ui :: Widget ui :: Widget
ui = ui =
vBox [ hBox [ padLeft Max $ vCenter "Left-padded" vBox [ hBox [ padLeft Max $ vCenter "Left-padded"
, vBorder , B.vBorder
, padRight Max $ vCenter "Right-padded" , padRight Max $ vCenter "Right-padded"
] ]
, hBorder , B.hBorder
, hBox [ padTop Max $ hCenter "Top-padded" , hBox [ padTop Max $ hCenter "Top-padded"
, vBorder , B.vBorder
, padBottom Max $ hCenter "Bottom-padded" , padBottom Max $ hCenter "Bottom-padded"
] ]
, hBorder , B.hBorder
, hBox [ padLeftRight (Pad 2) "Padded by 2 on left/right" , hBox [ padLeftRight (Pad 2) "Padded by 2 on left/right"
, vBorder , B.vBorder
, vBox [ padTopBottom (Pad 1) "Padded by 1 on top/bottom" , vBox [ padTopBottom (Pad 1) "Padded by 1 on top/bottom"
, hBorder , B.hBorder
] ]
] ]
, hBorder , B.hBorder
, padAll (Pad 2) "Padded by 2 on all sides" , padAll (Pad 2) "Padded by 2 on all sides"
] ]
app :: App () Event app :: App () V.Event
app = app =
App { appDraw = const [ui] App { appDraw = const [ui]
, appHandleEvent = resizeOrQuit , appHandleEvent = resizeOrQuit