From 32d3a8c83d46cfb69cb9c8654be76c2e92d23913 Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Fri, 21 Feb 2020 19:43:50 -0500 Subject: [PATCH] Initial add libscroll --- package.json | 6 ++++-- src/UI/dune | 2 +- src/UI_Components/ScrollView.re | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) 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 =>