switch from ncurses to brick #1

Merged
jlamothe merged 21 commits from brick into dev 2023-06-02 15:28:41 -04:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit 251dc90cea - Show all commits

View File

@ -27,8 +27,8 @@ import Brick.Types (Widget)
import Brick.Widgets.Core (str, vBox) import Brick.Widgets.Core (str, vBox)
import Control.Monad.State.Class (modify) import Control.Monad.State.Class (modify)
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import Lens.Micro ((^.), (.~), (%~)) import Lens.Micro ((^.))
import Lens.Micro.Mtl (use) import Lens.Micro.Mtl ((.=), (%=), use)
import Mtlstats.Actions import Mtlstats.Actions
import Mtlstats.Handlers import Mtlstats.Handlers
@ -101,9 +101,9 @@ deleteC _ = Controller
, handleController = \e -> case ynHandler e of , handleController = \e -> case ynHandler e of
Just True -> do Just True -> do
use (progMode.editGoalieStateL.egsSelectedGoalie) >>= mapM_ use (progMode.editGoalieStateL.egsSelectedGoalie) >>= mapM_
(\gid -> modify $ database.dbGoalies %~ dropNth gid) (\gid -> database.dbGoalies %= dropNth gid)
modify edit modify edit
Just False -> modify $ progMode.editGoalieStateL.egsMode .~ EGMenu Just False -> progMode.editGoalieStateL.egsMode .= EGMenu
Nothing -> return () Nothing -> return ()
} }

View File

@ -25,8 +25,8 @@ import Brick.Types (Widget)
import Brick.Widgets.Core (emptyWidget, str, vBox) import Brick.Widgets.Core (emptyWidget, str, vBox)
import Control.Monad.State.Class (modify) import Control.Monad.State.Class (modify)
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import Lens.Micro ((^.), (.~), (%~)) import Lens.Micro ((^.))
import Lens.Micro.Mtl (use) import Lens.Micro.Mtl ((.=), (%=), use)
import Mtlstats.Actions import Mtlstats.Actions
import Mtlstats.Handlers import Mtlstats.Handlers
@ -92,9 +92,9 @@ deleteC _ = Controller
, handleController = \e -> case ynHandler e of , handleController = \e -> case ynHandler e of
Just True -> do Just True -> do
use (progMode.editPlayerStateL.epsSelectedPlayer) >>= mapM_ use (progMode.editPlayerStateL.epsSelectedPlayer) >>= mapM_
(\pid -> modify $ database.dbPlayers %~ dropNth pid) (\pid -> database.dbPlayers %= dropNth pid)
modify edit modify edit
Just False -> modify $ progMode.editPlayerStateL.epsMode .~ EPMenu Just False -> progMode.editPlayerStateL.epsMode .= EPMenu
Nothing -> return () Nothing -> return ()
} }