* DeskWindow wasn't checking if the context menu for the trash was already open and showing. We do it like in ContainerWindow now. Fixes #353

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28089 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner
2008-10-14 14:46:47 +00:00
parent b2ade57dd9
commit e400b7d395
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -54,6 +54,7 @@ All rights reserved.
#include "IconMenuItem.h" #include "IconMenuItem.h"
#include "MountMenu.h" #include "MountMenu.h"
#include "PoseView.h" #include "PoseView.h"
#include "SlowContextPopup.h"
#include "Tracker.h" #include "Tracker.h"
#include "TemplatesMenu.h" #include "TemplatesMenu.h"
@@ -328,7 +329,7 @@ void
BDeskWindow::AddTrashContextMenu() BDeskWindow::AddTrashContextMenu()
{ {
// setup special trash context menu // setup special trash context menu
fTrashContextMenu = new BPopUpMenu("TrashContext", false, false); fTrashContextMenu = new BSlowContextMenu("TrashContext");
fTrashContextMenu->SetFont(be_plain_font); fTrashContextMenu->SetFont(be_plain_font);
fTrashContextMenu->AddItem(new BMenuItem("Empty Trash", fTrashContextMenu->AddItem(new BMenuItem("Empty Trash",
new BMessage(kEmptyTrash))); new BMessage(kEmptyTrash)));
@@ -349,9 +350,8 @@ BDeskWindow::ShowContextMenu(BPoint loc, const entry_ref *ref, BView *view)
DeleteSubmenu(fNavigationItem); DeleteSubmenu(fNavigationItem);
if (ref && entry.SetTo(ref) == B_OK && FSIsTrashDir(&entry)) { if (ref && entry.SetTo(ref) == B_OK && FSIsTrashDir(&entry)) {
//
// don't show any menu if this is the trash if (fTrashContextMenu->IsShowing() || Dragging())
if (Dragging() && FSIsTrashDir(&entry))
return; return;
// selected item was trash, show the trash context menu instead // selected item was trash, show the trash context menu instead
+2 -2
View File
@@ -41,7 +41,7 @@ All rights reserved.
#include "ContainerWindow.h" #include "ContainerWindow.h"
#include "DesktopPoseView.h" #include "DesktopPoseView.h"
class BPopUpMenu; class BSlowContextMenu;
namespace BPrivate { namespace BPrivate {
@@ -82,7 +82,7 @@ protected:
private: private:
BShelf *fDeskShelf; BShelf *fDeskShelf;
// shelf for replicant support // shelf for replicant support
BPopUpMenu *fTrashContextMenu; BSlowContextMenu *fTrashContextMenu;
BRect fOldFrame; BRect fOldFrame;