From e41dd5091f597e2252deb9ecbde900eda7c15614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Tue, 3 Sep 2013 00:00:50 -0300 Subject: Sorted index mode --- Screen.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Screen.hs') diff --git a/Screen.hs b/Screen.hs index 90954b1..5150e93 100644 --- a/Screen.hs +++ b/Screen.hs @@ -26,7 +26,7 @@ import Email(lookupField, getBody, getHeaders) import Print import Rfc1342 import State -import Types(LazymailCurses, LazymailUpdate) +import Types {- This function is the nexus between Curses and IO -} entryPoint :: Lazymail () @@ -153,13 +153,15 @@ drawEmailHeader = do let row = curRowAsInteger st setColor $ headerColorID . colorStyle $ st moveCursor row (colPadAsInteger st) - drawCroppedString st $ ("From: " ++) . ppField $ lookupField "from" hs + drawCroppedString st $ ("Date: " ++) . ppField $ lookupField "date" hs moveCursor (row + 1) (colPadAsInteger st) - drawCroppedString st $ ("To: " ++) . ppField $ lookupField "to" hs + drawCroppedString st $ ("From: " ++) . ppField $ lookupField "from" hs moveCursor (row + 2) (colPadAsInteger st) + drawCroppedString st $ ("To: " ++) . ppField $ lookupField "to" hs + moveCursor (row + 3) (colPadAsInteger st) drawCroppedString st $ ("Subject: " ++) . ppField $ lookupField "subject" hs setColor $ baseColorID . colorStyle $ st - put $ st { currentRow = (4 + currentRow st) } + put $ st { currentRow = (5 + currentRow st) } {- Draw the email body -} drawBody _ _ _ [] = return () @@ -233,7 +235,7 @@ resetScrollBuffer = do put st { maildirState = mst} IndexMode -> do let ist = (indexState st) { - scrollBufferIn = EH.scrollCrop 0 (screenRows st) $ selectedEmails . indexState $ st } + scrollBufferIn = EH.formatIndexModeRows st $ EH.scrollCrop 0 (screenRows st) $ selectedEmails . indexState $ st } put st { indexState = ist } drawCroppedString st str = drawString $ normalizeLen (screenColumns st) str -- cgit v1.2.3