summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-30 17:03:08 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-30 17:03:08 +0300
commit7404124bf2578b713f613a749b283e8a1ed1faa3 (patch)
treef39b62ae1d23dc47bfa1a7f9ad2885b4fb05e691
parenta5d4a43d93f1acc5b0fabe98e45bffb1bcbe34b3 (diff)
downloadmanaplus-7404124bf2578b713f613a749b283e8a1ed1faa3.tar.gz
manaplus-7404124bf2578b713f613a749b283e8a1ed1faa3.tar.bz2
manaplus-7404124bf2578b713f613a749b283e8a1ed1faa3.tar.xz
manaplus-7404124bf2578b713f613a749b283e8a1ed1faa3.zip
Add support for open mail message by double click.
-rw-r--r--src/gui/windows/mailwindow.cpp13
-rw-r--r--src/gui/windows/mailwindow.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp
index b23984c4c..e01bab225 100644
--- a/src/gui/windows/mailwindow.cpp
+++ b/src/gui/windows/mailwindow.cpp
@@ -263,3 +263,16 @@ void MailWindow::viewPrev(const int id)
}
}
}
+
+void MailWindow::mouseClicked(MouseEvent &event)
+{
+ if (event.getButton() == MouseButton::LEFT)
+ {
+ event.consume();
+ if (event.getClickCount() == 2 &&
+ event.getSource() == mListBox)
+ {
+ action(ActionEvent(mListBox, "open"));
+ }
+ }
+}
diff --git a/src/gui/windows/mailwindow.h b/src/gui/windows/mailwindow.h
index e1562f074..2013461d5 100644
--- a/src/gui/windows/mailwindow.h
+++ b/src/gui/windows/mailwindow.h
@@ -63,6 +63,8 @@ class MailWindow final : public Window,
void viewPrev(const int id);
+ void mouseClicked(MouseEvent &event) override final;
+
private:
std::vector<MailMessage*> mMessages;
std::map<int, MailMessage*> mMessagesMap;