Slightly tweak the volume slider's tracking logic to keep attention on the mouse even if it exits the view. This allows click dragging without having to be quite as precise. Fixes ticket #3317.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28962 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent
2009-01-20 01:07:42 +00:00
parent b2cd5c48e7
commit bd98bd9555
+5 -5
View File
@@ -324,6 +324,7 @@ SliderView::SliderView(BRect rect, BMessage *msg, const char *title,
SetTracking(true);
SetValue(value);
SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
}
@@ -400,17 +401,16 @@ SliderView::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
if (!IsTracking())
return;
uint32 mouseButtons;
BPoint where;
GetMouse(&where, &mouseButtons, true);
int32 mouseButtons;
Window()->CurrentMessage()->FindInt32("buttons", &mouseButtons);
// button not pressed, exit
if (! (mouseButtons & B_PRIMARY_MOUSE_BUTTON)) {
if (!(mouseButtons & B_PRIMARY_MOUSE_BUTTON)) {
Invoke();
SetTracking(false);
}
if (Value() == -1 || !Bounds().InsetBySelf(2, 2).Contains(point))
if (Value() == -1)
return;
float v = MIN(MAX(point.x, 11), 192);