[geary/wip/765516-gtk-widget-conversation-viewer: 145/174] Dismiss link popover when a link is activated.



commit 5b637833e4628ced9c8bc625a540dae37bac6d4d
Author: Michael James Gratton <mike vee net>
Date:   Thu Sep 8 10:53:51 2016 +1000

    Dismiss link popover when a link is activated.

 .../conversation-viewer/conversation-message.vala  |    6 ++++++
 ui/conversation-message.ui                         |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index c9f5ffe..eb598ee 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -1293,6 +1293,12 @@ public class ConversationMessage : Gtk.Grid {
         this.body.trigger_tooltip_query();
     }
 
+    [GtkCallback]
+    private bool on_link_popover_activated() {
+        this.link_popover.hide();
+        return Gdk.EVENT_PROPAGATE;
+    }
+
     private void on_selection_changed() {
         bool has_selection = false;
         if (web_view.has_selection()) {
diff --git a/ui/conversation-message.ui b/ui/conversation-message.ui
index 0355553..f6fe159 100644
--- a/ui/conversation-message.ui
+++ b/ui/conversation-message.ui
@@ -543,6 +543,7 @@
             <property name="can_focus">False</property>
             <property name="label">&lt;a 
href="http://goodlink.com"&gt;http://goodlink.com&lt;/a&gt;</property>
             <property name="use_markup">True</property>
+            <signal name="activate-link" handler="on_link_popover_activated" swapped="no"/>
           </object>
           <packing>
             <property name="left_attach">0</property>
@@ -566,6 +567,7 @@
             <property name="can_focus">False</property>
             <property name="label">&lt;a href="http://badlink.com"&gt;http://badlink.com&lt;/a&gt;</property>
             <property name="use_markup">True</property>
+            <signal name="activate-link" handler="on_link_popover_activated" swapped="no"/>
           </object>
           <packing>
             <property name="left_attach">0</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]