DiskUsage: Usability enhancement

* When clicking in a outer sector, the middle circle now takes the color the outer sector had, helping to keep some consistency.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35779 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Saint-Pierre
2010-03-07 21:07:24 +00:00
parent 478d0ad5d9
commit 98d5d91cbf
3 changed files with 9 additions and 0 deletions
+6
View File
@@ -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,
+1
View File
@@ -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.
+2
View File
@@ -35,6 +35,8 @@ struct FileInfo {
int count;
FileInfo* parent;
std::vector<FileInfo*> children;
int color;
};