forked from smallhadroncollider/taskell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47ca5b7
commit 5dbda01
Showing
11 changed files
with
68 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Keyboard ( | ||
module Flow.Keyboard ( | ||
isChar, | ||
isUp, | ||
isDown | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module CLI where | ||
module UI.CLI where | ||
|
||
import System.IO (stdout, hFlush) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module UI.Main where | ||
|
||
import Graphics.Vty | ||
|
||
attrTitle :: Attr | ||
attrTitle = defAttr `withForeColor` green | ||
|
||
marginBottom :: Image -> Image | ||
marginBottom = pad 0 0 0 1 | ||
|
||
-- creates the title element | ||
title = marginBottom $ string attrTitle "[Taskell]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module UI.Task where | ||
|
||
import Graphics.Vty | ||
import Data.Taskell.Task | ||
|
||
-- styles | ||
attrTask :: Attr | ||
attrTask = defAttr `withForeColor` magenta | ||
|
||
attrDone :: Attr | ||
attrDone = defAttr `withStyle` dim | ||
|
||
attrCurrent :: Attr | ||
attrCurrent = defAttr `withForeColor` blue | ||
|
||
-- style a task | ||
present :: Int -> Int -> Task -> Image | ||
present cur i t = string style' ("• " ++ s ++ tick) | ||
where | ||
s = description t | ||
tick = if completed t then " ✓" else "" | ||
style = if completed t then attrDone else attrTask | ||
style' = if cur == i then attrCurrent else style |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters