summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-02-08 16:36:59 -0700
committerJared Adams <jaxad0127@gmail.com>2010-02-08 16:36:59 -0700
commit8b4d9f9b5eaf175baf0c4209c312133bb457742c (patch)
treeaba4e8e98c345dc649a6d52221eed42ca88636a0 /src
parent401f9598674216edb373c647596ea92a63bc65b2 (diff)
downloadmana-8b4d9f9b5eaf175baf0c4209c312133bb457742c.tar.gz
mana-8b4d9f9b5eaf175baf0c4209c312133bb457742c.tar.bz2
mana-8b4d9f9b5eaf175baf0c4209c312133bb457742c.tar.xz
mana-8b4d9f9b5eaf175baf0c4209c312133bb457742c.zip
Open a WhisperTab when you double-click on an Avatar in an AvatarListBox
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp12
1 files changed, 12 insertions, 0 deletions
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<AvatarListModel*>(mListModel);
+ if (model)
+ {
+ chatWindow->addWhisperTab(model->getAvatarAt(selected)
+ ->getName(), true);
+ }
+ }
}
// TODO: Add support for context menu
else if (event.getButton() == gcn::MouseEvent::RIGHT)