diff --git a/src/kits/tracker/DeskWindow.cpp b/src/kits/tracker/DeskWindow.cpp index f2ecdb4d76..92298d61ca 100644 --- a/src/kits/tracker/DeskWindow.cpp +++ b/src/kits/tracker/DeskWindow.cpp @@ -54,7 +54,6 @@ All rights reserved. #include "IconMenuItem.h" #include "MountMenu.h" #include "PoseView.h" -#include "ShowingAwarePopUpMenu.h" #include "Tracker.h" #include "TemplatesMenu.h" @@ -329,7 +328,7 @@ void BDeskWindow::AddTrashContextMenu() { // setup special trash context menu - fTrashContextMenu = new BShowingAwarePopUpMenu("TrashContext"); + fTrashContextMenu = new BPopUpMenu("TrashContext"); fTrashContextMenu->SetFont(be_plain_font); fTrashContextMenu->AddItem(new BMenuItem("Empty Trash", new BMessage(kEmptyTrash))); @@ -351,7 +350,7 @@ BDeskWindow::ShowContextMenu(BPoint loc, const entry_ref *ref, BView *view) if (ref && entry.SetTo(ref) == B_OK && FSIsTrashDir(&entry)) { - if (fTrashContextMenu->IsShowing() || Dragging()) + if (fTrashContextMenu->Window() || Dragging()) return; // selected item was trash, show the trash context menu instead diff --git a/src/kits/tracker/DeskWindow.h b/src/kits/tracker/DeskWindow.h index a057ab2795..9e95dee7e4 100644 --- a/src/kits/tracker/DeskWindow.h +++ b/src/kits/tracker/DeskWindow.h @@ -41,10 +41,9 @@ All rights reserved. #include "ContainerWindow.h" #include "DesktopPoseView.h" +class BPopUpMenu; namespace BPrivate { - -class BShowingAwarePopUpMenu; class BDeskWindow : public BContainerWindow { public: @@ -83,7 +82,7 @@ protected: private: BShelf *fDeskShelf; // shelf for replicant support - BShowingAwarePopUpMenu *fTrashContextMenu; + BPopUpMenu *fTrashContextMenu; BRect fOldFrame; diff --git a/src/kits/tracker/Jamfile b/src/kits/tracker/Jamfile index 2fc6b11dcb..b231f78a06 100644 --- a/src/kits/tracker/Jamfile +++ b/src/kits/tracker/Jamfile @@ -72,7 +72,6 @@ SharedLibrary libtracker.so : Settings.cpp SettingsHandler.cpp SettingsViews.cpp - ShowingAwarePopUpMenu.cpp SlowContextPopup.cpp SlowMenu.cpp StatusWindow.cpp diff --git a/src/kits/tracker/ShowingAwarePopUpMenu.cpp b/src/kits/tracker/ShowingAwarePopUpMenu.cpp deleted file mode 100644 index 671aa2ea00..0000000000 --- a/src/kits/tracker/ShowingAwarePopUpMenu.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2008, Haiku Inc. - * Distributed under the terms of the MIT License. - * - * Authors: - * Alexandre Deckner, alex@zappotek.com - */ - -#include "ShowingAwarePopUpMenu.h" - - -BShowingAwarePopUpMenu::BShowingAwarePopUpMenu(const char *title, bool radioMode, - bool autoRename, menu_layout layout) - : BPopUpMenu(title, radioMode, autoRename, layout), - fIsShowing(false) -{ -} - - -BShowingAwarePopUpMenu::~BShowingAwarePopUpMenu() -{ -} - - -void -BShowingAwarePopUpMenu::AttachedToWindow() -{ - fIsShowing = true; - BPopUpMenu::AttachedToWindow(); -} - - -void -BShowingAwarePopUpMenu::DetachedFromWindow() -{ - fIsShowing = false; -} diff --git a/src/kits/tracker/ShowingAwarePopUpMenu.h b/src/kits/tracker/ShowingAwarePopUpMenu.h deleted file mode 100644 index ebd50c1d78..0000000000 --- a/src/kits/tracker/ShowingAwarePopUpMenu.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2008, Haiku, Inc. All Rights Reserved. - * Distributed under the terms of the MIT License. - */ -#ifndef _SHOWING_AWARE_POPUP_MENU_H -#define _SHOWING_AWARE_POPUP_MENU_H - -#include - - -namespace BPrivate { - -class BShowingAwarePopUpMenu : public BPopUpMenu { -public: - BShowingAwarePopUpMenu(const char *title, bool radioMode = true, - bool autoRename = true, menu_layout layout = B_ITEMS_IN_COLUMN); - virtual ~BShowingAwarePopUpMenu(); - - virtual void AttachedToWindow(); - virtual void DetachedFromWindow(); - - const bool IsShowing() const; - -private: - bool fIsShowing; -}; - -} // namespace BPrivate - -using namespace BPrivate; - -inline const bool -BShowingAwarePopUpMenu::IsShowing() const -{ - return fIsShowing; -} - -#endif