vty: fix warnings

This commit is contained in:
Simon Michael 2011-07-17 22:14:07 +00:00
parent 9db32e0f60
commit 5d5fb30685

View File

@ -157,10 +157,10 @@ setPosY y a@AppState{alocs=(l:locs)} = a{alocs=(l':locs)}
cy = y `mod` ph cy = y `mod` ph
sy = y - cy sy = y - cy
updateCursorY, updateScrollY, updatePosY :: (Int -> Int) -> AppState -> AppState updateCursorY, updateScrollY {-, updatePosY-} :: (Int -> Int) -> AppState -> AppState
updateCursorY f a = setCursorY (f $ cursorY a) a updateCursorY f a = setCursorY (f $ cursorY a) a
updateScrollY f a = setScrollY (f $ scrollY a) a updateScrollY f a = setScrollY (f $ scrollY a) a
updatePosY f a = setPosY (f $ posY a) a -- updatePosY f a = setPosY (f $ posY a) a
resize :: Int -> Int -> AppState -> AppState resize :: Int -> Int -> AppState -> AppState
resize x y a = setCursorY cy' a{aw=x,ah=y} resize x y a = setCursorY cy' a{aw=x,ah=y}
@ -228,8 +228,8 @@ popLoc a@AppState{alocs=locs}
clearLocs :: AppState -> AppState clearLocs :: AppState -> AppState
clearLocs a = a{alocs=[]} clearLocs a = a{alocs=[]}
exit :: AppState -> AppState -- exit :: AppState -> AppState
exit = popLoc -- exit = popLoc
loc :: AppState -> Loc loc :: AppState -> Loc
loc = head . alocs loc = head . alocs
@ -357,20 +357,20 @@ renderScreen (a@AppState{aw=w,ah=h,abuf=buf,amsg=msg}) =
padclipline = take w . (++ blankline) padclipline = take w . (++ blankline)
blankline = replicate w ' ' blankline = replicate w ' '
padClipString :: Int -> Int -> String -> [String] -- padClipString :: Int -> Int -> String -> [String]
padClipString h w s = rows -- padClipString h w s = rows
where -- where
rows = map padclipline $ take h $ lines s ++ replicate h blankline -- rows = map padclipline $ take h $ lines s ++ replicate h blankline
padclipline = take w . (++ blankline) -- padclipline = take w . (++ blankline)
blankline = replicate w ' ' -- blankline = replicate w ' '
renderString :: Attr -> String -> Image -- renderString :: Attr -> String -> Image
renderString attr s = vert_cat $ map (string attr) rows -- renderString attr s = vert_cat $ map (string attr) rows
where -- where
rows = lines $ fitto w h s -- rows = lines $ fitto w h s
w = maximum $ map length ls -- w = maximum $ map length ls
h = length ls -- h = length ls
ls = lines s -- ls = lines s
renderStatus :: Int -> String -> Image renderStatus :: Int -> String -> Image
renderStatus w = string statusattr . take w . (++ repeat ' ') renderStatus w = string statusattr . take w . (++ repeat ' ')
@ -398,9 +398,9 @@ data UITheme = Restrained | Colorful | Blood
,def_attr `with_style` reverse_video ,def_attr `with_style` reverse_video
) )
halfbrightattr = def_attr `with_style` dim -- halfbrightattr = def_attr `with_style` dim
reverseattr = def_attr `with_style` reverse_video -- reverseattr = def_attr `with_style` reverse_video
redattr = def_attr `with_fore_color` red -- redattr = def_attr `with_fore_color` red
greenattr = def_attr `with_fore_color` green -- greenattr = def_attr `with_fore_color` green
reverseredattr = def_attr `with_style` reverse_video `with_fore_color` red -- reverseredattr = def_attr `with_style` reverse_video `with_fore_color` red
reversegreenattr= def_attr `with_style` reverse_video `with_fore_color` green -- reversegreenattr= def_attr `with_style` reverse_video `with_fore_color` green