From 0ebeb9512515249f33a9334abf1c52cbb0b6b7bb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 17 Sep 2012 23:38:40 +0300 Subject: Add double click support in npc dialog. --- src/gui/widgets/listbox.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/gui/widgets') 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) -- cgit v1.2.3-70-g09d2