diff --git a/package.json b/package.json index 291f76aeb..012427171 100644 --- a/package.json +++ b/package.json @@ -55,14 +55,16 @@ "reason-sdl2": "^2.10.3016", "reason-skia": "github:revery-ui/reason-skia#69743dc", "revery-text-wrap": "github:revery-ui/revery-text-wrap#005385c", - "timber": "*" + "timber": "*", + "libscroll": "*" }, "resolutions": { "@esy-ocaml/libffi": "esy-ocaml/libffi#c61127d", "@opam/cmdliner": "1.0.2", "esy-cmake": "prometheansacrifice/esy-cmake#2a47392def755", "timber": "glennsl/timber#ae065bb", - "reason-harfbuzz": "revery-ui/reason-harfbuzz#0848520" + "reason-harfbuzz": "revery-ui/reason-harfbuzz#0848520", + "libscroll": "link:../libscroll-re" }, "devDependencies": { "ocaml": "~4.8", diff --git a/src/UI/dune b/src/UI/dune index fea1cf8b5..77f2b80c5 100644 --- a/src/UI/dune +++ b/src/UI/dune @@ -2,4 +2,4 @@ (name Revery_UI) (public_name Revery.UI) (preprocess (pps lwt_ppx ppx_deriving.show)) - (libraries brisk-reconciler lwt lwt.unix sdl2 skia flex rebez.lib Revery_Core Revery_Draw Revery_Math)) + (libraries brisk-reconciler lwt lwt.unix sdl2 skia flex rebez.lib Revery_Core Revery_Draw Revery_Math Libscroll)) diff --git a/src/UI_Components/ScrollView.re b/src/UI_Components/ScrollView.re index 01e3ccef2..35ce76d55 100644 --- a/src/UI_Components/ScrollView.re +++ b/src/UI_Components/ScrollView.re @@ -57,6 +57,9 @@ let%component make = let%hook (actualScrollLeft, setScrollLeft) = Hooks.state(scrollLeft); let%hook (bouncingState, setBouncingState) = Hooks.state(Idle); + let%hook (scrollview, setScrollview) = Hooks.state(() => Libscroll.scrollview_new()); + //setScrollview(_ => scrollview); + let%hook (actualScrollTop, _bounceAnimationState, resetBouncingAnimation) = switch (bouncingState) { | Idle =>