summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-17 23:38:40 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-17 23:38:40 +0300
commit0ebeb9512515249f33a9334abf1c52cbb0b6b7bb (patch)
tree5e7b5601b25c2fbd70271d7fca64a69277306c2d
parentcd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96 (diff)
downloadmv-0ebeb9512515249f33a9334abf1c52cbb0b6b7bb.tar.gz
mv-0ebeb9512515249f33a9334abf1c52cbb0b6b7bb.tar.bz2
mv-0ebeb9512515249f33a9334abf1c52cbb0b6b7bb.tar.xz
mv-0ebeb9512515249f33a9334abf1c52cbb0b6b7bb.zip
Add double click support in npc dialog.
-rw-r--r--src/gui/widgets/listbox.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index e588f2a66..978907f78 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -26,6 +26,7 @@
#include "configuration.h"
#include "keyevent.h"
+#include "gui/gui.h"
#include "gui/palette.h"
#include "gui/sdlinput.h"
#include "gui/theme.h"
@@ -144,10 +145,24 @@ void ListBox::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent A_UNUSED)
void ListBox::mousePressed(gcn::MouseEvent &event)
{
+
if (mDistributeMousePressed)
+ {
gcn::ListBox::mousePressed(event);
+ }
else
- mouseDragged(event);
+ {
+ if (event.getClickCount() == 2)
+ {
+ if (gui)
+ gui->resetClickCount();
+ gcn::ListBox::mousePressed(event);
+ }
+ else
+ {
+ mouseDragged(event);
+ }
+ }
}
void ListBox::mouseDragged(gcn::MouseEvent &event)