From e10d8e83762aa4d1662e8c40d3ef7bbbf9d6a158 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 17 Aug 2014 15:17:20 +0300 Subject: Use public item popup in dropshortcutcontainer. --- src/gui/widgets/dropshortcutcontainer.cpp | 18 +++++++----------- src/gui/widgets/dropshortcutcontainer.h | 1 - 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 8fe3a8b2b..9d423f8ac 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -48,14 +48,11 @@ DropShortcutContainer::DropShortcutContainer(Widget2 *const widget) : ShortcutContainer(widget), mItemClicked(false), - mItemPopup(new ItemPopup), mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)), mEquipedColor2(getThemeColor(Theme::ITEM_EQUIPPED_OUTLINE)), mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED)), mUnEquipedColor2(getThemeColor(Theme::ITEM_NOT_EQUIPPED_OUTLINE)) { - mItemPopup->postInit(); - if (dropShortcut) mMaxItems = dropShortcut->getItemCount(); else @@ -64,7 +61,6 @@ DropShortcutContainer::DropShortcutContainer(Widget2 *const widget) : DropShortcutContainer::~DropShortcutContainer() { - delete2(mItemPopup); } void DropShortcutContainer::setWidget2(const Widget2 *const widget) @@ -281,23 +277,23 @@ void DropShortcutContainer::mouseMoved(MouseEvent &event) if (item && viewport) { - mItemPopup->setItem(item); - mItemPopup->position(viewport->getMouseX(), viewport->getMouseY()); + itemPopup->setItem(item); + itemPopup->position(viewport->getMouseX(), viewport->getMouseY()); } else { - mItemPopup->setVisible(false); + itemPopup->setVisible(false); } } void DropShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { - if (mItemPopup) - mItemPopup->setVisible(false); + if (itemPopup) + itemPopup->setVisible(false); } void DropShortcutContainer::widgetHidden(const Event &event A_UNUSED) { - if (mItemPopup) - mItemPopup->setVisible(false); + if (itemPopup) + itemPopup->setVisible(false); } diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 1888292de..84d85c6c0 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -78,7 +78,6 @@ class DropShortcutContainer final : public ShortcutContainer private: bool mItemClicked; - ItemPopup *mItemPopup; Color mEquipedColor; Color mEquipedColor2; Color mUnEquipedColor; -- cgit v1.2.3-70-g09d2