From d764cc26be96a0bc35db8673661592721d24f695 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 20 Jun 2008 09:31:15 +0000 Subject: [PATCH] when we right click on a word in conversation textview, even if it's not selected, show actions menuitem to look in dictionary and so on. see #2874 --- src/conversation_textview.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/conversation_textview.py b/src/conversation_textview.py index 2b6cf7fcf..27740d064 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -657,6 +657,16 @@ class ConversationTextview: start_sel, finish_sel = return_val[0], return_val[1] self.selected_phrase = buffer.get_text(start_sel, finish_sel).decode( 'utf-8') + elif ord(iter.get_char()) > 31: + # we clicked on a word, do as if it's selected for context menu + start_sel = iter.copy() + if not start_sel.starts_word(): + start_sel.backward_word_start() + finish_sel = iter.copy() + if not finish_sel.ends_word(): + finish_sel.forward_word_end() + self.selected_phrase = buffer.get_text(start_sel, finish_sel).decode( + 'utf-8') def on_open_link_activate(self, widget, kind, text): helpers.launch_browser_mailer(kind, text)