From 440ef69c6b959b79047fe5817f80b95511f8ff7d Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 17 Mar 2009 12:52:32 +0000 Subject: [PATCH] Small oversight: clicking outside of the slider should also dismiss it. Thanks Stephan! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29569 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/desklink/VolumeSlider.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/desklink/VolumeSlider.cpp b/src/bin/desklink/VolumeSlider.cpp index 36954eaf48..6749710a97 100644 --- a/src/bin/desklink/VolumeSlider.cpp +++ b/src/bin/desklink/VolumeSlider.cpp @@ -323,6 +323,7 @@ SliderView::SliderView(BRect rect, BMessage *msg, const char *title, fButtonBitmap.SetBits(kButtonBits, kButtonWidth * kButtonHeight, 0, B_CMAP8); SetValue(value); + SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY); } @@ -381,8 +382,10 @@ SliderView::Draw(BRect updateRect) void SliderView::MouseDown(BPoint point) { - SetMouseEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY); - SetTracking(true); + if (Bounds().Contains(point)) + SetTracking(true); + else + Invoke(); }