[haiku-commits] r35779 - haiku/trunk/src/apps/diskusage

  • From: stpere@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 7 Mar 2010 22:07:24 +0100 (CET)

Author: stpere
Date: 2010-03-07 22:07:24 +0100 (Sun, 07 Mar 2010)
New Revision: 35779
Changeset: http://dev.haiku-os.org/changeset/35779/haiku

Modified:
   haiku/trunk/src/apps/diskusage/PieView.cpp
   haiku/trunk/src/apps/diskusage/Scanner.cpp
   haiku/trunk/src/apps/diskusage/Snapshot.h
Log:
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.



Modified: haiku/trunk/src/apps/diskusage/PieView.cpp
===================================================================
--- haiku/trunk/src/apps/diskusage/PieView.cpp  2010-03-07 18:50:40 UTC (rev 
35778)
+++ haiku/trunk/src/apps/diskusage/PieView.cpp  2010-03-07 21:07:24 UTC (rev 
35779)
@@ -488,6 +488,11 @@
                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 @@
 
                        // 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,

Modified: haiku/trunk/src/apps/diskusage/Scanner.cpp
===================================================================
--- haiku/trunk/src/apps/diskusage/Scanner.cpp  2010-03-07 18:50:40 UTC (rev 
35778)
+++ haiku/trunk/src/apps/diskusage/Scanner.cpp  2010-03-07 21:07:24 UTC (rev 
35779)
@@ -195,6 +195,7 @@
                        entry.GetRef(&child->ref);
                        entry.GetSize(&child->size);
                        child->parent = thisDir;
+                       child->color = -1;
                        thisDir->children.push_back(child);
 
                        // Send a progress report periodically.

Modified: haiku/trunk/src/apps/diskusage/Snapshot.h
===================================================================
--- haiku/trunk/src/apps/diskusage/Snapshot.h   2010-03-07 18:50:40 UTC (rev 
35778)
+++ haiku/trunk/src/apps/diskusage/Snapshot.h   2010-03-07 21:07:24 UTC (rev 
35779)
@@ -35,6 +35,8 @@
                        int                                     count;
                        FileInfo*                       parent;
                        std::vector<FileInfo*>  children;
+
+                       int                                     color;
 };
 
 


Other related posts:

  • » [haiku-commits] r35779 - haiku/trunk/src/apps/diskusage - stpere