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:
Rene Gollent
2009-03-17 01:34:50 +00:00
parent bd8837cd1b
commit 12c0fc92e1
2 changed files with 9 additions and 17 deletions
+8 -16
View File
@@ -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)
{
+1 -1
View File
@@ -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;