Skip to content

Commit

Permalink
moved Render out of UI
Browse files Browse the repository at this point in the history
  • Loading branch information
smallhadroncollider committed Nov 19, 2017
1 parent 3b45949 commit 83b00ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Main where

import UI.Render (render)
import Render (render)
import Flow.State (initial, setTasks)
import Persistence.Taskell (exists, readJSON)

Expand Down
12 changes: 6 additions & 6 deletions src/UI/Render.hs → src/Render.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module UI.Render (
module Render (
render
) where

Expand All @@ -10,8 +10,8 @@ import Persistence.Taskell (writeJSON)
import UI.Main (pic)

-- the draw loop
draw :: Vty -> State -> IO ()
draw vty state = do
loop :: Vty -> State -> IO ()
loop vty state = do
update vty $ pic state
e <- nextEvent vty

Expand All @@ -25,11 +25,11 @@ draw vty state = do

-- if event wasn't quit keep going, otherwise shutdown
if running state'
then draw vty state'
then loop vty state'
else shutdown vty

-- setup vty and start the draw loop
-- setup vty and start the loop
render :: State -> IO ()
render state = do
vty <- standardIOConfig >>= mkVty
draw vty state
loop vty state
2 changes: 1 addition & 1 deletion taskell.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ library
, Flow.Keyboard
, Flow.State
, Persistence.Taskell
, Render
, UI.CLI
, UI.List
, UI.Main
, UI.Render
, UI.Task
build-depends: base >= 4.7 && < 5
, vty
Expand Down

0 comments on commit 83b00ed

Please sign in to comment.