@@ -47,12 +47,14 @@ data Scrollable t = Scrollable
4747-- | Scrollable widget. The output exposes the current scroll position and
4848-- total number of lines (including those that are hidden)
4949scrollable
50- :: forall t m . (Reflex t , MonadHold t m , MonadFix m , HasDisplayRegion t m , HasInput t m , HasImageWriter t m , HasTheme t m )
50+ :: forall t m a .
51+ ( Reflex t , MonadHold t m , MonadFix m
52+ , HasDisplayRegion t m , HasInput t m , HasImageWriter t m , HasTheme t m )
5153 => ScrollableConfig t
52- -> (m (Behavior t V. Image , Event t () ))
53- -> m (Scrollable t )
54+ -> (m (Behavior t V. Image , Event t () , a ))
55+ -> m (Scrollable t , a )
5456scrollable (ScrollableConfig scrollBy scrollTo startingPos onAppend) mkImg = do
55- (img, update) <- mkImg
57+ (img, update, a ) <- mkImg
5658 let sz = V. imageHeight <$> img
5759 kup <- key V. KUp
5860 kdown <- key V. KDown
@@ -85,7 +87,7 @@ scrollable (ScrollableConfig scrollBy scrollTo startingPos onAppend) mkImg = do
8587 ScrollPos_Top -> images -- take height images
8688 ScrollPos_Line n -> V. translateY ((- 1 ) * n) images
8789 tellImages $ fmap (: [] ) $ imgsToTell <$> current dh <*> current lineIndex <*> sz <*> img
88- return $ Scrollable
90+ return $ (,a) $ Scrollable
8991 { _scrollable_scrollPosition = current lineIndex
9092 , _scrollable_totalLines = sz
9193 , _scrollable_scrollHeight = current dh
0 commit comments