From 329f76a9415bebc9c3b021ec1b2c374d1110ee87 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 5 May 2026 22:05:16 -0400 Subject: [PATCH] Tracker: No count view pop up on file panels or open with windows either. Change-Id: I1694cf92e72f7f15120ffa0a96eb13ba9e49aa93 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10937 Haiku-Format: Haiku-format Bot Reviewed-by: John Scipione --- src/kits/tracker/CountView.cpp | 18 ++++++++++++------ src/kits/tracker/CountView.h | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) 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;