Clean up using hlint and --pedantic
This commit is contained in:
parent
89248a34d1
commit
b524441d9c
7 changed files with 62 additions and 41 deletions
|
|
@ -1,14 +1,15 @@
|
|||
{-# LANGUAGE RecordWildCards #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module TaskMachine.UI.TaskList where
|
||||
|
||||
import qualified Brick as B
|
||||
import qualified Brick.Widgets.Edit as B
|
||||
|
||||
import TaskMachine.LTask
|
||||
import TaskMachine.Todotxt
|
||||
import TaskMachine.UI.Types
|
||||
|
||||
{-
|
||||
widgetPriority :: B.AttrName -> Maybe Priority -> B.Widget n
|
||||
widgetPriority _ Nothing = B.emptyWidget
|
||||
widgetPriority highlight (Just prio) =
|
||||
|
|
@ -28,3 +29,12 @@ renderLTask highlight (LTask _ Task{..}) =
|
|||
wPriority = widgetPriority attrHighlight taskPriority
|
||||
wDescription = widgetDescription attrHighlight taskDescription
|
||||
in B.hBox [wCompleted, wPriority, wDescription]
|
||||
-}
|
||||
|
||||
renderLTask :: Maybe (B.Editor String RName) -> Bool -> LTask -> B.Widget RName
|
||||
renderLTask _ False (LTask _ t) = B.withAttr normal $ B.str $ formatTask t
|
||||
where normal = "normal" <> "priority"
|
||||
renderLTask Nothing True (LTask _ t) = B.withAttr highlight $ B.str $ formatTask t
|
||||
where highlight = "highlight" <> "priority"
|
||||
renderLTask (Just edit) True _ = B.withAttr highlight $ B.renderEditor (B.str . unlines) True edit
|
||||
where highlight = "highlight" <> "priority"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue