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:
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -35,6 +35,8 @@ struct FileInfo {
|
||||
int count;
|
||||
FileInfo* parent;
|
||||
std::vector<FileInfo*> children;
|
||||
|
||||
int color;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user