summaryrefslogtreecommitdiff
path: root/Applications/IRCClient
diff options
context:
space:
mode:
authorBrendan Coles <bcoles@gmail.com>2020-04-08 16:49:10 +0000
committerAndreas Kling <kling@serenityos.org>2020-04-08 18:42:01 +0200
commite4ba949a1588ab172ba1362bb26c4d54d7b0d6a5 (patch)
tree377c8cc2c5c33afd82b4a276f43a869d54348fbe /Applications/IRCClient
parent036fb4c62188f984a4eefa4948d1b807320463da (diff)
downloadserenity-e4ba949a1588ab172ba1362bb26c4d54d7b0d6a5.zip
IRCClient: Open query on double click of nick in channel member list
Diffstat (limited to 'Applications/IRCClient')
-rw-r--r--Applications/IRCClient/IRCWindow.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Applications/IRCClient/IRCWindow.cpp b/Applications/IRCClient/IRCWindow.cpp
index b00d031d60..68742817ed 100644
--- a/Applications/IRCClient/IRCWindow.cpp
+++ b/Applications/IRCClient/IRCWindow.cpp
@@ -62,6 +62,14 @@ IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& na
member_view.set_alternating_row_colors(false);
member_view.set_model(channel().member_model());
member_view.set_activates_on_selection(true);
+ member_view.on_activation = [&](auto& index) {
+ if (!index.is_valid())
+ return;
+ auto nick = channel().member_model()->nick_at(member_view.selection().first());
+ if (nick.is_empty())
+ return;
+ m_client.handle_open_query_action(m_client.nick_without_prefix(nick.characters()));
+ };
member_view.on_context_menu_request = [&](const GUI::ModelIndex& index, const GUI::ContextMenuEvent& event) {
if (!index.is_valid())
return;