Implemented absolute scrollbar setting via right mouse button as discussed on the list.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19316 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -502,6 +502,11 @@ BScrollBar::MouseDown(BPoint where)
|
||||
|
||||
SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS);
|
||||
|
||||
int32 buttons = B_PRIMARY_MOUSE_BUTTON;
|
||||
if (Looper() != NULL && Looper()->CurrentMessage() != NULL
|
||||
&& Looper()->CurrentMessage()->FindInt32("buttons", &buttons) != B_OK)
|
||||
buttons = B_PRIMARY_MOUSE_BUTTON;
|
||||
|
||||
// hit test for the thumb
|
||||
if (fPrivateData->fThumbFrame.Contains(where)) {
|
||||
fPrivateData->fButtonDown = THUMB;
|
||||
@@ -510,6 +515,19 @@ BScrollBar::MouseDown(BPoint where)
|
||||
return;
|
||||
}
|
||||
|
||||
if (buttons & B_SECONDARY_MOUSE_BUTTON) {
|
||||
// special absolute scrolling: move thumb to where we clicked
|
||||
fPrivateData->fButtonDown = THUMB;
|
||||
fPrivateData->fClickOffset = fPrivateData->fThumbFrame.LeftTop() - where;
|
||||
if (Orientation() == B_HORIZONTAL)
|
||||
fPrivateData->fClickOffset.x = -fPrivateData->fThumbFrame.Width() / 2;
|
||||
else
|
||||
fPrivateData->fClickOffset.y = -fPrivateData->fThumbFrame.Height() / 2;
|
||||
|
||||
SetValue(_ValueFor(where + fPrivateData->fClickOffset));
|
||||
return;
|
||||
}
|
||||
|
||||
// hit test for arrows or empty area
|
||||
float scrollValue = 0.0;
|
||||
fPrivateData->fButtonDown = _ButtonFor(where);
|
||||
|
||||
Reference in New Issue
Block a user