From 5f2f72a2884e6b9ca9f1715edfe5218b520ee6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Fri, 18 Apr 2008 17:30:00 +0000 Subject: [PATCH] Accepts drops on legends. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25030 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/activitymonitor/ActivityView.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/apps/activitymonitor/ActivityView.cpp b/src/apps/activitymonitor/ActivityView.cpp index e90b95f62d..9fa8e54bf5 100644 --- a/src/apps/activitymonitor/ActivityView.cpp +++ b/src/apps/activitymonitor/ActivityView.cpp @@ -744,7 +744,17 @@ ActivityView::MessageReceived(BMessage* message) fBackgroundColor = *color; _UpdateOffscreenBitmap(true); } else { - // XXX: check each legend color box ? + // check each legend color box + BRect legendFrame = _LegendFrame(); + int32 i; + for (i = 0; i < fSources.CountItems(); i++) { + BRect r = _LegendFrameAt(legendFrame, i); + if (r.Contains(dropPoint)) { + fSources.ItemAt(i)->SetColor(*color); + return; + } + } + // background SetLowColor(*color); } return;