summaryrefslogtreecommitdiff
path: root/src/gui/chatwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r--src/gui/chatwindow.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 35b89b839..9ba54016e 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -55,6 +55,7 @@
#include "net/playerhandler.h"
#include "net/net.h"
+#include "utils/copynpaste.h"
#include "utils/dtor.h"
#include "utils/gettext.h"
#include "utils/stringutils.h"
@@ -1540,4 +1541,18 @@ void ChatWindow::parseHighlights()
bool ChatWindow::findHighlight(std::string &str)
{
return findI(str, mHighlights) != std::string::npos;
-} \ No newline at end of file
+}
+
+void ChatWindow::copyToClipboard(int x, int y)
+{
+ ChatTab *tab = getFocused();
+ if (!tab)
+ return;
+
+ BrowserBox *text = tab->mTextOutput;
+ if (!text)
+ return;
+
+ std::string str = text->getTextAtPos(x, y);
+ sendBuffer(str);
+}