From 8b4d9f9b5eaf175baf0c4209c312133bb457742c Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 8 Feb 2010 16:36:59 -0700 Subject: Open a WhisperTab when you double-click on an Avatar in an AvatarListBox --- src/gui/widgets/avatarlistbox.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gui/widgets/avatarlistbox.cpp') diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 2c82d79c..23de8904 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -23,6 +23,7 @@ #include "graphics.h" +#include "gui/chat.h" #include "gui/gui.h" #include "gui/palette.h" @@ -136,6 +137,17 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) int y = event.getY(); setSelected(y / getFont()->getHeight()); distributeActionEvent(); + + if (event.getClickCount() == 2) + { + int selected = getSelected(); + AvatarListModel *model = dynamic_cast(mListModel); + if (model) + { + chatWindow->addWhisperTab(model->getAvatarAt(selected) + ->getName(), true); + } + } } // TODO: Add support for context menu else if (event.getButton() == gcn::MouseEvent::RIGHT) -- cgit v1.2.3-60-g2f50