DiskUsage: update status view after zoom in or zoom out. fixes #6756.

This commit is contained in:
Philippe Saint-Pierre
2012-11-14 22:33:44 -05:00
parent a4ef1e81ce
commit 9029fc709b
2 changed files with 13 additions and 2 deletions
+10 -1
View File
@@ -135,7 +135,8 @@ PieView::PieView(BVolume* volume)
fVolume(volume), fVolume(volume),
fMouseOverInfo(), fMouseOverInfo(),
fClicked(false), fClicked(false),
fDragging(false) fDragging(false),
fUpdateFileAt(false)
{ {
fMouseOverMenu = new BPopUpMenu(kEmptyStr, false, false); fMouseOverMenu = new BPopUpMenu(kEmptyStr, false, false);
fMouseOverMenu->AddItem(new BMenuItem(B_TRANSLATE("Get Info"), NULL), fMouseOverMenu->AddItem(new BMenuItem(B_TRANSLATE("Get Info"), NULL),
@@ -239,9 +240,13 @@ PieView::MouseUp(BPoint where)
if (info != NULL) { if (info != NULL) {
if (info == fScanner->CurrentDir()) { if (info == fScanner->CurrentDir()) {
fScanner->ChangeDir(info->parent); fScanner->ChangeDir(info->parent);
fLastWhere = where;
fUpdateFileAt = true;
Invalidate(); Invalidate();
} else if (info->children.size() > 0) { } else if (info->children.size() > 0) {
fScanner->ChangeDir(info); fScanner->ChangeDir(info);
fLastWhere = where;
fUpdateFileAt = true;
Invalidate(); Invalidate();
} }
} }
@@ -301,6 +306,10 @@ PieView::Draw(BRect updateRect)
_DrawPieChart(updateRect); _DrawPieChart(updateRect);
if (fWindow != NULL) if (fWindow != NULL)
fWindow->SetRescanEnabled(true); fWindow->SetRescanEnabled(true);
if (fUpdateFileAt) {
fWindow->ShowInfo(_FileAt(fLastWhere));
fUpdateFileAt = false;
}
} }
} }
} }
+3 -1
View File
@@ -91,7 +91,9 @@ private:
bool fClicked; bool fClicked;
bool fDragging; bool fDragging;
BPoint fDragStart; BPoint fDragStart;
FileInfo* fClickedFile; FileInfo* fClickedFile;
BPoint fLastWhere;
bool fUpdateFileAt;
}; };
#endif // PIE_VIEW_H #endif // PIE_VIEW_H