summaryrefslogtreecommitdiff
path: root/src/gui/widgets/shoplistbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/shoplistbox.cpp')
-rw-r--r--src/gui/widgets/shoplistbox.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index cc622653d..889cf4129 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -224,6 +224,21 @@ void ShopListBox::mouseMoved(gcn::MouseEvent &event)
}
}
+void ShopListBox::mouseReleased(gcn::MouseEvent& mouseEvent)
+{
+ ListBox::mousePressed(mouseEvent);
+ if (mouseEvent.getButton() == gcn::MouseEvent::RIGHT)
+ {
+ setSelected(std::max(0, getSelectionByMouse(mouseEvent.getY())));
+
+ if (mSelected < 0 || mSelected >= mShopItems->getNumberOfElements())
+ return;
+
+ Item *const item = mShopItems->at(mSelected);
+ viewport->showItemPopup(item);
+ }
+}
+
void ShopListBox::mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED)
{
if (!mItemPopup)