Skip to content

Commit

Permalink
scroll area support page{up,down}
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Mar 11, 2020
1 parent 1535b61 commit 8a6a229
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/nottui-widgets/nottui_widgets.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8a6a229

Please sign in to comment.