From 8a6a229f18948b9339917ddff643e52e20a1c9dc Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 11 Mar 2020 15:05:21 -0500 Subject: [PATCH] scroll area support page{up,down} --- lib/nottui-widgets/nottui_widgets.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/nottui-widgets/nottui_widgets.ml b/lib/nottui-widgets/nottui_widgets.ml index dbb98a8..b5e159e 100644 --- a/lib/nottui-widgets/nottui_widgets.ml +++ b/lib/nottui-widgets/nottui_widgets.ml @@ -77,6 +77,8 @@ let vscroll_area ~state ~change t = (*| `Arrow `Right, _ -> scroll (+scroll_step) 0*) | `Arrow `Up , [] -> scroll state (-scroll_step) | `Arrow `Down , [] -> scroll state (+scroll_step) + | `Page `Up, [] -> scroll state ((-scroll_step) * 8) + | `Page `Down, [] -> scroll state ((+scroll_step) * 8) | _ -> `Unhandled in let scroll_handler state ~x:_ ~y:_ = function @@ -120,6 +122,8 @@ let scroll_area ?(offset=0,0) t = | `Arrow `Right, [] -> scroll (+scroll_step) 0 | `Arrow `Up , [] -> scroll 0 (-scroll_step) | `Arrow `Down , [] -> scroll 0 (+scroll_step) + | `Page `Up, [] -> scroll 0 ((-scroll_step) * 8) + | `Page `Down, [] -> scroll 0 ((+scroll_step) * 8) | _ -> `Unhandled in let scroll_handler ~x:_ ~y:_ = function