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 <[email protected]> Reviewed-by: John Scipione <[email protected]>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -61,6 +61,8 @@ public:
|
||||
void StartBarberPole();
|
||||
void EndBarberPole();
|
||||
|
||||
bool ShouldHaveDirectoryPopUpMenu();
|
||||
|
||||
void SetTypeAhead(const char*);
|
||||
const char* TypeAhead() const;
|
||||
bool IsTypingAhead() const;
|
||||
|
||||
Reference in New Issue
Block a user