Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20045 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-02-02 12:44:51 +00:00
parent a83c8bbffa
commit f55ffadf96
+13 -14
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2006, Haiku, Inc.
* Copyright (c) 2001-2007, Haiku, Inc.
* Distributed under the terms of the MIT license.
*
* Authors:
@@ -493,7 +493,7 @@ BScrollBar::MessageReceived(BMessage *msg)
}
}
// MouseDown
void
BScrollBar::MouseDown(BPoint where)
{
@@ -502,20 +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)
int32 buttons;
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)
&& (buttons & B_SECONDARY_MOUSE_BUTTON) == 0) {
fPrivateData->fButtonDown = THUMB;
fPrivateData->fClickOffset = fPrivateData->fThumbFrame.LeftTop() - where;
Invalidate(fPrivateData->fThumbFrame);
return;
}
if (buttons & B_SECONDARY_MOUSE_BUTTON) {
// special absolute scrolling: move thumb to where we clicked
fPrivateData->fButtonDown = THUMB;
@@ -529,6 +520,14 @@ BScrollBar::MouseDown(BPoint where)
return;
}
// hit test for the thumb
if (fPrivateData->fThumbFrame.Contains(where)) {
fPrivateData->fButtonDown = THUMB;
fPrivateData->fClickOffset = fPrivateData->fThumbFrame.LeftTop() - where;
Invalidate(fPrivateData->fThumbFrame);
return;
}
// hit test for arrows or empty area
float scrollValue = 0.0;
fPrivateData->fButtonDown = _ButtonFor(where);