aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-02-03 05:35:29 +0000
committercorvid <corvid@lavabit.com>2011-02-03 05:35:29 +0000
commit5a5a12ffa743d70df6848da4d142443535a30c01 (patch)
treee0879d81018247df1a83083f40189cd3a06f3994
parent857c0495cc404c233ecaa7537a5733fd6878e403 (diff)
use Fl_Group::handle() to pass events to scrollbars
It turns out that Fl_Group::handle() is where some of the magic lives that makes pushed() and FL_DRAG all work properly so that you can drag the scrollbar without keeping the cursor within its confines.
-rw-r--r--dw/fltkviewport.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/dw/fltkviewport.cc b/dw/fltkviewport.cc
index 88f1cac0..7572f0a6 100644
--- a/dw/fltkviewport.cc
+++ b/dw/fltkviewport.cc
@@ -206,16 +206,10 @@ int FltkViewport::handle (int event)
{
_MSG("FltkViewport::handle %d\n", event);
- if (Fl::event_inside(hscrollbar) &&
- !(Fl::event_state() & (FL_SHIFT | FL_CTRL | FL_ALT)) &&
- hscrollbar->handle (event)) {
- return 1;
- }
-
- if (Fl::event_inside(vscrollbar) &&
- vscrollbar->handle (event)) {
- return 1;
- }
+ if (Fl::event_inside(vscrollbar) ||
+ (Fl::event_inside(hscrollbar) &&
+ !(Fl::event_state() & (FL_SHIFT | FL_CTRL | FL_ALT))))
+ return Fl_Group::handle(event);
switch(event) {
case FL_KEYBOARD: