summaryrefslogtreecommitdiff
path: root/src/gui/windows/inventorywindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-17 14:34:57 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-17 14:34:57 +0300
commit3f815d7ae9767416b6205e521cc3f06bc4299fcf (patch)
tree005e0fe233e3fb7ed29782c322c9818caef39c7a /src/gui/windows/inventorywindow.cpp
parent5613e19f91676fddbdedb371a6fe07786268bb92 (diff)
downloadmanaverse-3f815d7ae9767416b6205e521cc3f06bc4299fcf.tar.gz
manaverse-3f815d7ae9767416b6205e521cc3f06bc4299fcf.tar.bz2
manaverse-3f815d7ae9767416b6205e521cc3f06bc4299fcf.tar.xz
manaverse-3f815d7ae9767416b6205e521cc3f06bc4299fcf.zip
Use public text popup in inventory window.
Diffstat (limited to 'src/gui/windows/inventorywindow.cpp')
-rw-r--r--src/gui/windows/inventorywindow.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index d148d4d7d..53e847af0 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -103,11 +103,9 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
mNameFilterCell(nullptr),
mFilterCell(nullptr),
mSlotsBarCell(nullptr),
- mTextPopup(new TextPopup),
mSplit(false),
mCompactMode(false)
{
- mTextPopup->postInit();
mSlotsBar->setColor(getThemeColor(Theme::SLOTS_BAR),
getThemeColor(Theme::SLOTS_BAR_OUTLINE));
@@ -284,7 +282,6 @@ InventoryWindow::~InventoryWindow()
mSortDropDown->hideDrop(false);
delete2(mSortModel);
- mTextPopup = nullptr;
}
void InventoryWindow::storeSortOrder() const
@@ -565,25 +562,28 @@ void InventoryWindow::mouseClicked(MouseEvent &event)
void InventoryWindow::mouseMoved(MouseEvent &event)
{
Window::mouseMoved(event);
+ if (!textPopup)
+ return;
+
const Widget *const src = event.getSource();
if (src == mSlotsBar || src == mWeightBar)
{
const int x = event.getX();
const int y = event.getY();
const Rect &rect = mDimension;
- mTextPopup->show(rect.x + x, rect.y + y, strprintf(_("Money: %s"),
+ textPopup->show(rect.x + x, rect.y + y, strprintf(_("Money: %s"),
Units::formatCurrency(PlayerInfo::getAttribute(
Attributes::MONEY)).c_str()));
}
else
{
- mTextPopup->hide();
+ textPopup->hide();
}
}
void InventoryWindow::mouseExited(MouseEvent &event A_UNUSED)
{
- mTextPopup->hide();
+ textPopup->hide();
}
void InventoryWindow::keyPressed(KeyEvent &event)