@@ -47,12 +47,14 @@ data Scrollable t = Scrollable
47
47
-- | Scrollable widget. The output exposes the current scroll position and
48
48
-- total number of lines (including those that are hidden)
49
49
scrollable
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 )
51
53
=> 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 )
54
56
scrollable (ScrollableConfig scrollBy scrollTo startingPos onAppend) mkImg = do
55
- (img, update) <- mkImg
57
+ (img, update, a ) <- mkImg
56
58
let sz = V. imageHeight <$> img
57
59
kup <- key V. KUp
58
60
kdown <- key V. KDown
@@ -85,7 +87,7 @@ scrollable (ScrollableConfig scrollBy scrollTo startingPos onAppend) mkImg = do
85
87
ScrollPos_Top -> images -- take height images
86
88
ScrollPos_Line n -> V. translateY ((- 1 ) * n) images
87
89
tellImages $ fmap (: [] ) $ imgsToTell <$> current dh <*> current lineIndex <*> sz <*> img
88
- return $ Scrollable
90
+ return $ (,a) $ Scrollable
89
91
{ _scrollable_scrollPosition = current lineIndex
90
92
, _scrollable_totalLines = sz
91
93
, _scrollable_scrollHeight = current dh
0 commit comments