perfectionist details and building
This commit is contained in:
parent
47454593d7
commit
70f3992691
|
@ -22,7 +22,7 @@ library
|
||||||
other-modules:
|
other-modules:
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
build-depends: base ^>=4.14.1.0
|
build-depends: base
|
||||||
, wreq
|
, wreq
|
||||||
, aeson
|
, aeson
|
||||||
, lens-aeson
|
, lens-aeson
|
||||||
|
@ -44,7 +44,7 @@ executable kino
|
||||||
other-modules:
|
other-modules:
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
ghc-options: -Wall -threaded
|
ghc-options: -Wall -threaded
|
||||||
build-depends: base ^>=4.14.1.0
|
build-depends: base
|
||||||
, kino
|
, kino
|
||||||
hs-source-dirs: app
|
hs-source-dirs: app
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
@ -54,4 +54,4 @@ test-suite kino-test
|
||||||
type: exitcode-stdio-1.0
|
type: exitcode-stdio-1.0
|
||||||
hs-source-dirs: test
|
hs-source-dirs: test
|
||||||
main-is: MyLibTest.hs
|
main-is: MyLibTest.hs
|
||||||
build-depends: base ^>=4.14.1.0
|
build-depends: base
|
||||||
|
|
|
@ -62,9 +62,7 @@ runApp = defaultMain app initialState
|
||||||
|
|
||||||
-- | The starting event which grabs the inital listing
|
-- | The starting event which grabs the inital listing
|
||||||
startEvent :: AppS -> EventM Ident AppS
|
startEvent :: AppS -> EventM Ident AppS
|
||||||
startEvent s = do
|
startEvent = liftIO . setMovies
|
||||||
-- todo move unwrapping our response structure into a function
|
|
||||||
pure =<< liftIO (setMovies s)
|
|
||||||
|
|
||||||
-- | The drawing function which defers to the proper function
|
-- | The drawing function which defers to the proper function
|
||||||
-- from UI.Widgets
|
-- from UI.Widgets
|
||||||
|
|
|
@ -30,14 +30,12 @@ select = withAttr (attrName "selected")
|
||||||
-- movie to the widget second widget. Used by movieWidgets
|
-- movie to the widget second widget. Used by movieWidgets
|
||||||
widgetCons :: AppS -> JSONMovie -> Widget Ident -> Widget Ident
|
widgetCons :: AppS -> JSONMovie -> Widget Ident -> Widget Ident
|
||||||
widgetCons s m w =
|
widgetCons s m w =
|
||||||
embed $ if Just m == (s ^. appDetails)
|
(<=> w) $ if Just m == (s ^. appDetails)
|
||||||
then select . visible $
|
then select . visible $
|
||||||
if s ^. appExpanded
|
if s ^. appExpanded
|
||||||
then expandedWidget m
|
then expandedWidget m
|
||||||
else movieWidget m
|
else movieWidget m
|
||||||
else movieWidget m
|
else movieWidget m
|
||||||
where
|
|
||||||
embed = (<=> w)
|
|
||||||
|
|
||||||
-- | Returns a big list of all movies
|
-- | Returns a big list of all movies
|
||||||
movieWidgets :: AppS -> Widget Ident
|
movieWidgets :: AppS -> Widget Ident
|
||||||
|
|
Loading…
Reference in New Issue
Block a user