diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-10-12 21:51:58 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-10-13 13:59:06 +0200 |
commit | 667f7fd713bc2d4f9196bc71e2b8ac8b2ca210f1 (patch) | |
tree | ccb9554f418217655fbbafb94117bb4d0a0d66fc | |
parent | 1f7e5f5c258c3d66e1704ee48a11c79c65f8354b (diff) |
Scroll full pages with mouse wheel
When using the scroll wheel over a page, holding Shift will cause full
pages to be scrolled instead of scroll steps. The same effect can be
achieved by scrolling over the vertical scrollbar.
-rw-r--r-- | doc/user_help.in.html | 3 | ||||
-rw-r--r-- | dw/fltkviewport.cc | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/doc/user_help.in.html b/doc/user_help.in.html index 25129668..3edc870d 100644 --- a/doc/user_help.in.html +++ b/doc/user_help.in.html @@ -188,6 +188,7 @@ doesn't require a network connection. <li>Using the <em>mouse</em> or <em>pointing device</em>: <ul> <li>Rotate the mouse wheel to move one <em>step</em> in that direction. + Hold Shift to move one <em>page</em> instead. <li>Keep the middle button (or mouse wheel button) pressed while dragging to scroll the page precisely. </ul> @@ -202,6 +203,8 @@ doesn't require a network connection. specific position of the page. <li>Click the scrollbar arrows to move the view one <em>step</em> in that direction. + <li>Rotate the mouse wheel over the vertical scrollbar to move one + <em>page</em> in that direction. </ul> </li> </ul> diff --git a/dw/fltkviewport.cc b/dw/fltkviewport.cc index f0b69cb8..b8f4e51e 100644 --- a/dw/fltkviewport.cc +++ b/dw/fltkviewport.cc @@ -348,6 +348,16 @@ int FltkViewport::handle (int event) break; case FL_MOUSEWHEEL: + if ((vscrollbar->visible() && Fl::event_inside(vscrollbar)) || + Fl::event_shift()) { + if (Fl::event_dy() > 0) { + scroll(core::SCREEN_DOWN_CMD); + return 1; + } else if (Fl::event_dy() < 0) { + scroll(core::SCREEN_UP_CMD); + return 1; + } + } return (Fl::event_dx() ? hscrollbar : vscrollbar)->handle(event); break; |