Somewhat adjusted the behavior of the volume slider. It now stays up when initially clicked and requires a second mouseclick to begin tracking it. This prevents abrupt volume changes as would be seen if you had previously turned down the volume and then invoked the volume control again (it would immediately jump to whatever level the mouse cursor happened to be at when the slider popped up). This fixes ticket #3570.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29568 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -322,9 +322,7 @@ SliderView::SliderView(BRect rect, BMessage *msg, const char *title,
|
||||
fRightBitmap.SetBits(kRightBits, kRightWidth * kRightHeight, 0, B_CMAP8);
|
||||
fButtonBitmap.SetBits(kButtonBits, kButtonWidth * kButtonHeight, 0, B_CMAP8);
|
||||
|
||||
SetTracking(true);
|
||||
SetValue(value);
|
||||
SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
||||
}
|
||||
|
||||
|
||||
@@ -333,20 +331,6 @@ SliderView::~SliderView()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SliderView::Pulse()
|
||||
{
|
||||
uint32 mouseButtons;
|
||||
BPoint where;
|
||||
GetMouse(&where, &mouseButtons, true);
|
||||
// button not pressed, exit
|
||||
if (!(mouseButtons & B_PRIMARY_MOUSE_BUTTON)) {
|
||||
SetTracking(false);
|
||||
Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SliderView::Draw(BRect updateRect)
|
||||
{
|
||||
@@ -394,6 +378,14 @@ SliderView::Draw(BRect updateRect)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SliderView::MouseDown(BPoint point)
|
||||
{
|
||||
SetMouseEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY);
|
||||
SetTracking(true);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SliderView::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
|
||||
{
|
||||
|
||||
@@ -40,9 +40,9 @@ class SliderView : public BControl {
|
||||
~SliderView();
|
||||
|
||||
virtual void Draw(BRect);
|
||||
virtual void MouseDown(BPoint point);
|
||||
virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
|
||||
virtual void MouseUp(BPoint point);
|
||||
virtual void Pulse();
|
||||
|
||||
private:
|
||||
BBitmap fLeftBitmap, fRightBitmap, fButtonBitmap;
|
||||
|
||||
Reference in New Issue
Block a user