summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-24 12:52:07 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-24 12:52:07 +0300
commite5b72708a91fa21740ac2397cf0a39b38c4d7aa3 (patch)
tree26cf9777b6bc342741c303d2abcd89aad2ab9e98 /src/gui
parent30ea9ca03a5ccd617d9c6c1e07c3db38b0209402 (diff)
downloadmanaverse-e5b72708a91fa21740ac2397cf0a39b38c4d7aa3.tar.gz
manaverse-e5b72708a91fa21740ac2397cf0a39b38c4d7aa3.tar.bz2
manaverse-e5b72708a91fa21740ac2397cf0a39b38c4d7aa3.tar.xz
manaverse-e5b72708a91fa21740ac2397cf0a39b38c4d7aa3.zip
fix double click handling in itemcontainer.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/itemcontainer.cpp27
1 files 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<int>(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<int>(SHORTCUT_TABS))
+ {
+ if (itemShortcut[num])
+ itemShortcut[num]->setItemSelected(item);
+ }
}
+ if (shopWindow)
+ shopWindow->setItemSelected(item->getId());
}
- if (shopWindow)
- shopWindow->setItemSelected(item->getId());
}
else
{