From 54e192aa8c4a50a225a13364fe1df2a11d965a20 Mon Sep 17 00:00:00 2001 From: Joscha Date: Tue, 23 Oct 2018 15:31:24 +0000 Subject: [PATCH] Change syntax highlighting --- src/TaskMachine/UI/Task.hs | 5 ++++- src/TaskMachine/UI/Types.hs | 2 +- todo.txt | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/TaskMachine/UI/Task.hs b/src/TaskMachine/UI/Task.hs index 5a2c311..01fc34e 100644 --- a/src/TaskMachine/UI/Task.hs +++ b/src/TaskMachine/UI/Task.hs @@ -30,7 +30,10 @@ withSpace :: B.Widget n -> B.Widget n withSpace w = w B.<+> B.withDefAttr taskAttr (B.str " ") renderCompletion :: Completion -> B.Widget n -renderCompletion = B.withDefAttr taskCompletionAttr . B.str . formatCompletion +renderCompletion Incomplete = B.str "-" +renderCompletion (Complete Nothing) = B.str "x" +renderCompletion (Complete (Just day)) = + B.str "x" B.<+> B.withDefAttr taskCompletionAttr (B.str $ formatDate day) renderPriority :: Priority -> B.Widget n renderPriority p = diff --git a/src/TaskMachine/UI/Types.hs b/src/TaskMachine/UI/Types.hs index f39235d..93af906 100644 --- a/src/TaskMachine/UI/Types.hs +++ b/src/TaskMachine/UI/Types.hs @@ -53,7 +53,7 @@ defaultTheme = B.newTheme VTY.defAttr , (B.listSelectedAttr, st' VTY.bold) , (B.listSelectedFocusedAttr, bg VTY.blue $ st' VTY.bold) , (taskAttr, none) - , (taskCompletionAttr, none) + , (taskCompletionAttr, fg' VTY.brightBlack) , (taskPriorityAttr, fg VTY.cyan $ st' VTY.bold) , (taskPriorityAttr <> "A", fg VTY.red $ st' VTY.bold) , (taskPriorityAttr <> "B", fg VTY.yellow $ st' VTY.bold) diff --git a/todo.txt b/todo.txt index eecbfce..af28786 100644 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,6 @@ -- c2018-09-18 Offer to clean up file when loading (adding creation/completion dates) +- c2018-09-18 Clean up file (adding creation/completion dates) - c2018-09-18 Purge - move completed tasks to a separate file -- c2018-09-28 Move cursor to beginning of task description when editing tasks +x2018-10-23 c2018-09-28 Move cursor to beginning of task description when editing tasks - c2018-09-28 Syntax highlighting while editing tasks x2018-10-23 c2018-09-30 Display "-empty-" when TaskList is empty x2018-09-27 c2018-09-18 Quit using Esc or q @@ -9,3 +9,4 @@ x2018-09-30 c2018-09-18 Offer "retry" or "quit" +dialogue - couldn't load from t x2018-09-30 c2018-09-18 Offer "retry" or "quit" +dialogue - couldn't save to todo file x2018-09-30 c2018-09-18 Offer "retry" or "quit" +dialogue - syntax error in todo file x2018-09-30 c2018-09-30 Custom exception messages +- c2018-10-23 Don't crash on parse errors etc.