mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-11-29 10:54:48 +03:00
Misc updates
This commit is contained in:
parent
5e91b0b617
commit
857faebbf6
@ -15,11 +15,10 @@ data St =
|
||||
|
||||
drawUI :: St -> Widget
|
||||
drawUI st =
|
||||
let ew = edit (stEditor st)
|
||||
in vBox [ ew `withAttr` (cyan `on` blue)
|
||||
, hBorder '-'
|
||||
, "stuff and things"
|
||||
]
|
||||
vBox [ edit (stEditor st) `withAttr` (cyan `on` blue)
|
||||
, hBorder '-'
|
||||
, "stuff and things"
|
||||
]
|
||||
|
||||
handleEvent :: Event -> St -> Either ExitCode St
|
||||
handleEvent e st =
|
||||
@ -36,10 +35,10 @@ pickCursor st ls =
|
||||
initialState :: St
|
||||
initialState =
|
||||
let eName = Name "edit"
|
||||
St { msg = ""
|
||||
, focus = focusRing [eName]
|
||||
, stEditor = editor eName ""
|
||||
}
|
||||
in St { msg = ""
|
||||
, focus = focusRing [eName]
|
||||
, stEditor = editor eName ""
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
main = standardIOConfig
|
||||
|
@ -41,7 +41,7 @@ data Editor =
|
||||
}
|
||||
|
||||
editor :: Name -> String -> Editor
|
||||
editor name s = Editor s (length name) name
|
||||
editor name s = Editor s (length s) name
|
||||
|
||||
edit :: Editor -> Widget
|
||||
edit e =
|
||||
|
Loading…
Reference in New Issue
Block a user