From e5b72708a91fa21740ac2397cf0a39b38c4d7aa3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 24 Jun 2013 12:52:07 +0300 Subject: fix double click handling in itemcontainer. --- src/gui/widgets/itemcontainer.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 997e1af7f..972c066ac 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -409,22 +409,25 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) } else if (item && item->getId()) { - dragDrop.dragItem(item, DRAGDROP_SOURCE_INVENTORY); - dragDrop.select(item); - setSelectedIndex(index); - mSelectionStatus = SEL_SELECTING; - - if (itemShortcutWindow) + if (index >= 0) { - const int num = itemShortcutWindow->getTabIndex(); - if (num >= 0 && num < static_cast(SHORTCUT_TABS)) + dragDrop.dragItem(item, DRAGDROP_SOURCE_INVENTORY); + dragDrop.select(item); + setSelectedIndex(index); + mSelectionStatus = SEL_SELECTING; + + if (itemShortcutWindow) { - if (itemShortcut[num]) - itemShortcut[num]->setItemSelected(item); + const int num = itemShortcutWindow->getTabIndex(); + if (num >= 0 && num < static_cast(SHORTCUT_TABS)) + { + if (itemShortcut[num]) + itemShortcut[num]->setItemSelected(item); + } } + if (shopWindow) + shopWindow->setItemSelected(item->getId()); } - if (shopWindow) - shopWindow->setItemSelected(item->getId()); } else { -- cgit v1.2.3-70-g09d2