From e750667bd241fa4df353af591adec52427419361 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Tue, 28 Sep 2010 19:18:21 +0200 Subject: Removing click-count Click-count is not double-click, because it does neither check if the clicks happen on the same object nor if the clicks happen in rapid succession. * In the server dialog it can happen that you can get connected by just selecting a server. * In the social window it can happen that you open a chat by just clicking once on a name. * In the inventory window you better only select useable items if you want to use them, because they might get used by just selecting them. * And in case you actually want to use double-click, it often does not work, because click-count is already larger than 2. This reverts the commits: 8b4d9f9b5eaf175baf0c4209c312133bb457742c b1aef06ac85b1ed7db7725e50b2dbfcdfd1a0925 4c27bfbf6ca84546e5b914b7909df14dd2966081 Reviewed-by: Thorbjorn --- src/gui/widgets/itemcontainer.cpp | 40 ++++----------------------------------- 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'src/gui/widgets/itemcontainer.cpp') diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 7648eb24..fb5105b2 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -255,46 +255,14 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) if (mSelectedIndex == index) { - if(event.getClickCount() == 2) - { - if (item->isEquipment()) - { - if (item->isEquipped()) - Net::getInventoryHandler()->unequipItem(item); - else - Net::getInventoryHandler()->equipItem(item); - } - else - Net::getInventoryHandler()->useItem(item); - - } - else - { - mSelectionStatus = SEL_DESELECTING; - } + mSelectionStatus = SEL_DESELECTING; } else if (item && item->getId()) { - if(event.getClickCount() == 2) - { - if (item->isEquipment()) - { - if (item->isEquipped()) - Net::getInventoryHandler()->unequipItem(item); - else - Net::getInventoryHandler()->equipItem(item); - } - else - Net::getInventoryHandler()->useItem(item); + setSelectedIndex(index); + mSelectionStatus = SEL_SELECTING; + itemShortcut->setItemSelected(item->getId()); - } - else - { - setSelectedIndex(index); - mSelectionStatus = SEL_SELECTING; - - itemShortcut->setItemSelected(item->getId()); - } if (item->isEquipment()) outfitWindow->setItemSelected(item->getId()); } -- cgit v1.2.3-60-g2f50