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:
@@ -324,6 +324,7 @@ SliderView::SliderView(BRect rect, BMessage *msg, const char *title,
|
|||||||
|
|
||||||
SetTracking(true);
|
SetTracking(true);
|
||||||
SetValue(value);
|
SetValue(value);
|
||||||
|
SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -400,9 +401,8 @@ SliderView::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
|
|||||||
if (!IsTracking())
|
if (!IsTracking())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 mouseButtons;
|
int32 mouseButtons;
|
||||||
BPoint where;
|
Window()->CurrentMessage()->FindInt32("buttons", &mouseButtons);
|
||||||
GetMouse(&where, &mouseButtons, true);
|
|
||||||
|
|
||||||
// button not pressed, exit
|
// button not pressed, exit
|
||||||
if (!(mouseButtons & B_PRIMARY_MOUSE_BUTTON)) {
|
if (!(mouseButtons & B_PRIMARY_MOUSE_BUTTON)) {
|
||||||
@@ -410,7 +410,7 @@ SliderView::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
|
|||||||
SetTracking(false);
|
SetTracking(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Value() == -1 || !Bounds().InsetBySelf(2, 2).Contains(point))
|
if (Value() == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float v = MIN(MAX(point.x, 11), 192);
|
float v = MIN(MAX(point.x, 11), 192);
|
||||||
|
|||||||
Reference in New Issue
Block a user