From 4a319b9c4016521e6ffcca751b067fdae8a7705d Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sun, 31 Jul 2016 18:45:00 -0700 Subject: [PATCH] Tracker FindPanel: SetMarked() and SetTargetForItems() in AttachedToWindow() rather than the constructor. This does the action at the appropriate time to draw the initial state correctly. --- src/kits/tracker/FindPanel.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kits/tracker/FindPanel.cpp b/src/kits/tracker/FindPanel.cpp index d3529ea274..2951a4d1d6 100644 --- a/src/kits/tracker/FindPanel.cpp +++ b/src/kits/tracker/FindPanel.cpp @@ -947,6 +947,10 @@ FindPanel::AttachedToWindow() } fMimeTypeMenu->SetTargetForItems(this); + BMenuItem* firstItem = fMimeTypeMenu->ItemAt(0); + if (firstItem != NULL) + firstItem->SetMarked(true); + if (fDraggableIcon != NULL) fDraggableIcon->SetTarget(BMessenger(this)); @@ -1843,7 +1847,6 @@ FindPanel::AddMimeTypesToMenu() static_cast(NULL)); MimeTypeMenu()->AddItem(firstItem); MimeTypeMenu()->AddSeparatorItem(); - firstItem->SetMarked(true); // add recent MIME types @@ -1915,8 +1918,6 @@ FindPanel::AddMimeTypesToMenu() } else submenu->SetTargetForItems(this); } - - MimeTypeMenu()->SetTargetForItems(this); }