diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-17 23:38:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-17 23:38:40 +0300 |
commit | 0ebeb9512515249f33a9334abf1c52cbb0b6b7bb (patch) | |
tree | 5e7b5601b25c2fbd70271d7fca64a69277306c2d /src/gui/widgets | |
parent | cd24ed1c6c5aab358b4f18d262bd4c00c0ebfe96 (diff) | |
download | manaverse-0ebeb9512515249f33a9334abf1c52cbb0b6b7bb.tar.gz manaverse-0ebeb9512515249f33a9334abf1c52cbb0b6b7bb.tar.bz2 manaverse-0ebeb9512515249f33a9334abf1c52cbb0b6b7bb.tar.xz manaverse-0ebeb9512515249f33a9334abf1c52cbb0b6b7bb.zip |
Add double click support in npc dialog.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/listbox.cpp | 17 |
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) |