aboutsummaryrefslogtreecommitdiff
path: root/Screen.hs
diff options
context:
space:
mode:
authorRaúl Benencia <rul@kalgan.cc>2013-08-28 11:28:38 -0300
committerRaúl Benencia <rul@kalgan.cc>2013-08-28 11:28:38 -0300
commit470b88d719fb6e740569c8e35affa0db6d3ed7fd (patch)
treee44d0cb2374e33625148b02c6b51e599a83a4832 /Screen.hs
parent77112dd4cd7657ebf16734d117d42283ee34c742 (diff)
Colorful header
Diffstat (limited to 'Screen.hs')
-rw-r--r--Screen.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Screen.hs b/Screen.hs
index 98dbfa0..699f1b6 100644
--- a/Screen.hs
+++ b/Screen.hs
@@ -50,7 +50,8 @@ startCurses = do
basColID <- newColorID (fst . baseColor $ cfg) (snd . baseColor $ cfg) 1
selColID <- newColorID (fst . selectionColor $ cfg) (snd . selectionColor $ cfg) 2
staColID <- newColorID (fst . statusBarColor $ cfg) (snd . statusBarColor $ cfg) 3
- let style = ColorStyle defaultColorID selColID staColID
+ heaColID <- newColorID (fst . headerColor $ cfg) (snd . headerColor $ cfg) 3
+ let style = ColorStyle defaultColorID selColID staColID heaColID
return $ st { screenRows = fromIntegral $ rows - 1
, screenColumns = fromIntegral $ cols
, colorStyle = style }
@@ -135,15 +136,18 @@ drawEmailHelper = do
let cropWith xs = normalizeLen $ (screenColumns st) - (length xs)
let row = curRowAsInteger st
liftUpdate $ do
+ setColor $ headerColorID . colorStyle $ st
moveCursor row (colPadAsInteger st)
drawString $ ("From: " ++) $ cropWith "From: " . ppNameAddr . getFrom $ fs
moveCursor (row + 1) (colPadAsInteger st)
drawString $ ("To: " ++) $ cropWith "To: " . ppNameAddr . getTo $ fs
moveCursor (row + 2) (colPadAsInteger st)
drawString $ ("Subject: " ++) $ cropWith "Subject: " . ppSubject . getSubject $ fs
+ setColor $ baseColorID . colorStyle $ st
let body = getBody $ selectedEmail . indexState $ st
- liftUpdate $ drawBody (row + 4) (colPadAsInteger st) (scrRowsAsInteger st) $ formatBody body (screenColumns st)
+ let maxRows = if statusBar st then (scrRowsAsInteger st) - 1 else scrRowsAsInteger st
+ liftUpdate $ drawBody (row + 4) (colPadAsInteger st) maxRows $ formatBody body (screenColumns st)
where drawBody _ _ _ [] = return ()
drawBody row col maxRows (xs:xss) = do
nihil fit ex nihilo