summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-12 18:52:54 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-12 18:52:54 +0300
commite82b08179b74bd8bf54157897ee06626422f72b8 (patch)
treef1da901d6894ec0dd4c671758766c30c64c354a2 /src/gui/widgets
parent3198ea5c33e58c71cdd489c32fcc3c864c2fe6e1 (diff)
downloadmv-e82b08179b74bd8bf54157897ee06626422f72b8.tar.gz
mv-e82b08179b74bd8bf54157897ee06626422f72b8.tar.bz2
mv-e82b08179b74bd8bf54157897ee06626422f72b8.tar.xz
mv-e82b08179b74bd8bf54157897ee06626422f72b8.zip
add double click selection in chat selection dialog.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/characterdisplay.cpp8
-rw-r--r--src/gui/widgets/characterdisplay.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp
index dba6be286..1815ec395 100644
--- a/src/gui/widgets/characterdisplay.cpp
+++ b/src/gui/widgets/characterdisplay.cpp
@@ -42,6 +42,8 @@ CharacterDisplay::CharacterDisplay(const Widget2 *const widget,
{
mPlayerBox->setActionEventId("select");
mPlayerBox->addActionListener(charSelectDialog);
+ setActionEventId("use");
+ addActionListener(charSelectDialog);
LayoutHelper h(this);
ContainerPlacer placer = h.getPlacer(0, 0);
@@ -114,3 +116,9 @@ void CharacterDisplay::mouseMoved(gcn::MouseEvent &event)
SDL_GetMouseState(&mouseX, &mouseY);
mPopup->show(mouseX, mouseY, mName->getCaption());
}
+
+void CharacterDisplay::mousePressed(gcn::MouseEvent &event)
+{
+ if (event.getClickCount() == 2)
+ distributeActionEvent();
+}
diff --git a/src/gui/widgets/characterdisplay.h b/src/gui/widgets/characterdisplay.h
index c7302ef48..ed8a36031 100644
--- a/src/gui/widgets/characterdisplay.h
+++ b/src/gui/widgets/characterdisplay.h
@@ -79,6 +79,8 @@ class CharacterDisplay final : public Container,
void mouseMoved(gcn::MouseEvent &event) override;
+ void mousePressed(gcn::MouseEvent &event);
+
private:
void update();