Added synchronous mouse support (shouldn't I lock the window ? why does it work without locking ?), now the thumb bitmap is drawn with B_OP_OVER, thus eliminating a visual glitch.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12504 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -269,7 +269,10 @@ BChannelSlider::MouseDown(BPoint where)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fCurrentChannel != -1) {
|
// Click wasn't on a slider.
|
||||||
|
if (fCurrentChannel == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
uint32 buttons = 0;
|
uint32 buttons = 0;
|
||||||
BMessage *currentMessage = Window()->CurrentMessage();
|
BMessage *currentMessage = Window()->CurrentMessage();
|
||||||
if (currentMessage != NULL)
|
if (currentMessage != NULL)
|
||||||
@@ -298,12 +301,17 @@ BChannelSlider::MouseDown(BPoint where)
|
|||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseMovedCommon(where, where);
|
MouseMovedCommon(where, B_ORIGIN);
|
||||||
SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS | B_NO_POINTER_HISTORY);
|
SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS | B_NO_POINTER_HISTORY);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
debugger("BChannelSlider::MouseDown(): SYNCHRONOUS CONTROLS NOT YET SUPPORTED");
|
do {
|
||||||
}
|
snooze(30000);
|
||||||
|
GetMouse(&where, &buttons);
|
||||||
|
MouseMovedCommon(where, B_ORIGIN);
|
||||||
|
} while (buttons != 0);
|
||||||
|
FinishChange();
|
||||||
|
fCurrentChannel = -1;
|
||||||
|
fAllChannels = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -474,25 +482,26 @@ BChannelSlider::DrawThumb(BView *into, int32 channel, BPoint where, bool pressed
|
|||||||
where.x -= bitmapBounds.right / 2;
|
where.x -= bitmapBounds.right / 2;
|
||||||
where.y -= bitmapBounds.bottom / 2;
|
where.y -= bitmapBounds.bottom / 2;
|
||||||
|
|
||||||
|
into->PushState();
|
||||||
|
|
||||||
|
into->SetDrawingMode(B_OP_OVER);
|
||||||
into->DrawBitmapAsync(thumb, where);
|
into->DrawBitmapAsync(thumb, where);
|
||||||
|
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
into->PushState();
|
|
||||||
|
|
||||||
into->SetDrawingMode(B_OP_ALPHA);
|
into->SetDrawingMode(B_OP_ALPHA);
|
||||||
|
|
||||||
rgb_color color = tint_color(into->ViewColor(), B_DARKEN_4_TINT);
|
rgb_color color = tint_color(into->ViewColor(), B_DARKEN_4_TINT);
|
||||||
color.alpha = 128;
|
color.alpha = 128;
|
||||||
into->SetHighColor(color);
|
into->SetHighColor(color);
|
||||||
|
|
||||||
BRect rect(where, where);
|
BRect destRect(where, where);
|
||||||
rect.right += bitmapBounds.right;
|
destRect.right += bitmapBounds.right;
|
||||||
rect.bottom += bitmapBounds.bottom;
|
destRect.bottom += bitmapBounds.bottom;
|
||||||
|
|
||||||
into->FillRect(rect);
|
into->FillRect(destRect);
|
||||||
|
}
|
||||||
|
|
||||||
into->PopState();
|
into->PopState();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user