diff --git a/src/kits/tracker/CountView.cpp b/src/kits/tracker/CountView.cpp index 557ec34045..b83e623ffb 100644 --- a/src/kits/tracker/CountView.cpp +++ b/src/kits/tracker/CountView.cpp @@ -267,7 +267,8 @@ BCountView::Draw(BRect updateRect) // leave room for pop up indicator float popUpWidth = be_control_look->DefaultItemSpacing(); - if (!fPoseView->TargetModel()->IsRoot()) + bool popsUp = ShouldHaveDirectoryPopUpMenu(); + if (popsUp) textRect.right -= popUpWidth; int32 truncateMode; @@ -290,7 +291,7 @@ BCountView::Draw(BRect updateRect) DrawString(itemString.String()); // draw pop up indicator - if (!fPoseView->TargetModel()->IsRoot()) { + if (popsUp) { BRect arrowRect(bounds); arrowRect.left = bounds.right - popUpWidth; float fgTint = (color.IsLight() ? B_DARKEN_4_TINT : 2.f - B_DARKEN_4_TINT); @@ -346,10 +347,7 @@ BCountView::MouseDown(BPoint) window->Activate(); window->UpdateIfNeeded(); - if (fPoseView->IsFilePanel() || fPoseView->TargetModel() == NULL) - return; - - if (window->TargetModel()->IsRoot()) + if (fPoseView->TargetModel() == NULL || !ShouldHaveDirectoryPopUpMenu()) return; BDirMenu menu(NULL, be_app, B_REFS_RECEIVED); @@ -375,6 +373,14 @@ BCountView::AttachedToWindow() } +bool +BCountView::ShouldHaveDirectoryPopUpMenu() +{ + return !(fPoseView->TargetModel()->IsRoot() || fPoseView->IsFilePanel() + || fPoseView->IsOpenWithView()); +} + + void BCountView::SetTypeAhead(const char* string) { diff --git a/src/kits/tracker/CountView.h b/src/kits/tracker/CountView.h index 9137e99dde..cb0c025ad6 100644 --- a/src/kits/tracker/CountView.h +++ b/src/kits/tracker/CountView.h @@ -61,6 +61,8 @@ public: void StartBarberPole(); void EndBarberPole(); + bool ShouldHaveDirectoryPopUpMenu(); + void SetTypeAhead(const char*); const char* TypeAhead() const; bool IsTypingAhead() const;