diff --git a/src/apps/diskusage/PieView.cpp b/src/apps/diskusage/PieView.cpp index a79261bf23..411c2c1992 100644 --- a/src/apps/diskusage/PieView.cpp +++ b/src/apps/diskusage/PieView.cpp @@ -488,6 +488,11 @@ PieView::_DrawDirectory(BRect b, FileInfo* info, float parentSpan, return 0.0; } + if (info != NULL && info->color >= 0 && level == 0) + colorIdx = info->color; + else if (info != NULL) + info->color = colorIdx; + VolumeSnapshot* snapshot = fScanners[fCurrentVolume]->Snapshot(); float cx = floorf(b.left + b.Width() / 2.0 + 0.5); @@ -528,6 +533,7 @@ PieView::_DrawDirectory(BRect b, FileInfo* info, float parentSpan, // Record in-use space and free space for use during MouseMoved(). info = snapshot->rootDir; + info->color = colorIdx; fMouseOverInfo[0].push_back(Segment(0.0, mySpan, info)); if (mySpan < 360.0 - kMinSegmentSpan) { fMouseOverInfo[0].push_back(Segment(mySpan, 360.0, diff --git a/src/apps/diskusage/Scanner.cpp b/src/apps/diskusage/Scanner.cpp index f9d1db3ccb..68006afe40 100644 --- a/src/apps/diskusage/Scanner.cpp +++ b/src/apps/diskusage/Scanner.cpp @@ -195,6 +195,7 @@ Scanner::_GetFileInfo(BDirectory* dir, FileInfo* parent) entry.GetRef(&child->ref); entry.GetSize(&child->size); child->parent = thisDir; + child->color = -1; thisDir->children.push_back(child); // Send a progress report periodically. diff --git a/src/apps/diskusage/Snapshot.h b/src/apps/diskusage/Snapshot.h index f28dfe2b22..c7c3698997 100644 --- a/src/apps/diskusage/Snapshot.h +++ b/src/apps/diskusage/Snapshot.h @@ -35,6 +35,8 @@ struct FileInfo { int count; FileInfo* parent; std::vector children; + + int color; };