diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-24 12:52:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-24 12:52:07 +0300 |
commit | e5b72708a91fa21740ac2397cf0a39b38c4d7aa3 (patch) | |
tree | 26cf9777b6bc342741c303d2abcd89aad2ab9e98 /src | |
parent | 30ea9ca03a5ccd617d9c6c1e07c3db38b0209402 (diff) | |
download | plus-e5b72708a91fa21740ac2397cf0a39b38c4d7aa3.tar.gz plus-e5b72708a91fa21740ac2397cf0a39b38c4d7aa3.tar.bz2 plus-e5b72708a91fa21740ac2397cf0a39b38c4d7aa3.tar.xz plus-e5b72708a91fa21740ac2397cf0a39b38c4d7aa3.zip |
fix double click handling in itemcontainer.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 27 |
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 { |