From c958e7145b56c0b69409adf2c4343eb17f93803b Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 8 Apr 2005 07:25:24 +0000 Subject: [PATCH] Now draws the nice thumb "frame" git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12270 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/ChannelSlider.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/kits/interface/ChannelSlider.cpp b/src/kits/interface/ChannelSlider.cpp index 1207b6dc0b..d6749a77bd 100644 --- a/src/kits/interface/ChannelSlider.cpp +++ b/src/kits/interface/ChannelSlider.cpp @@ -452,15 +452,12 @@ BChannelSlider::DrawChannel(BView *into, int32 channel, BRect area, bool pressed void BChannelSlider::DrawGroove(BView *into, int32 channel, BPoint topLeft, BPoint bottomRight) { - // TODO: Draw the real thing ASSERT(into != NULL); BRect rect(topLeft, bottomRight); - if (Vertical()) - rect.InsetBy(-1, 0); - else - rect.InsetBy(0, -1); - + DrawThumbFrame(fBackingView, rect.InsetByCopy(-2.5, -2.5)); + + rect.InsetBy(-0.5, -0.5); into->FillRect(rect, B_SOLID_HIGH); } @@ -662,7 +659,7 @@ BChannelSlider::DrawThumbs() BPoint drawHere; drawHere.x = (Bounds().Width() - fBacking->Bounds().Width()) / 2; - drawHere.y = (Bounds().Height() - fBacking->Bounds().Height()) / 2 ; + drawHere.y = (Bounds().Height() - fBacking->Bounds().Height()) / 2; if (fBacking->Lock()) { // Clear the view's background @@ -689,8 +686,20 @@ BChannelSlider::DrawThumbs() void -BChannelSlider::DrawThumbFrame(BView *where, const BRect &area) +BChannelSlider::DrawThumbFrame(BView *into, const BRect &area) { + rgb_color oldColor = into->HighColor(); + + into->SetHighColor(255, 255, 255); + into->StrokeRect(area); + into->SetHighColor(tint_color(into->ViewColor(), B_DARKEN_1_TINT)); + into->StrokeLine(area.LeftTop(), BPoint(area.right, area.top)); + into->StrokeLine(area.LeftTop(), BPoint(area.left, area.bottom - 1)); + into->SetHighColor(tint_color(into->ViewColor(), B_DARKEN_2_TINT)); + into->StrokeLine(BPoint(area.left + 1, area.top + 1), BPoint(area.right - 1, area.top + 1)); + into->StrokeLine(BPoint(area.left + 1, area.top + 1), BPoint(area.left + 1, area.bottom - 2)); + + into->SetHighColor(oldColor); }