[geary/wip/765516-gtk-widget-conversation-viewer: 99/119] Minor conversation viewer code cleanup.



commit c9e003868d4b1bc268bbb0cc136447a76ad483da
Author: Michael James Gratton <mike vee net>
Date:   Fri Jul 29 10:26:10 2016 +1000

    Minor conversation viewer code cleanup.

 .../conversation-viewer/conversation-email.vala    |   14 +++++++++-----
 .../conversation-viewer/conversation-message.vala  |   14 ++++++--------
 2 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-email.vala 
b/src/client/conversation-viewer/conversation-email.vala
index 03388f5..9de4220 100644
--- a/src/client/conversation-viewer/conversation-email.vala
+++ b/src/client/conversation-viewer/conversation-email.vala
@@ -304,6 +304,8 @@ public class ConversationEmail : Gtk.Box {
             });
         insert_action_group("eml", message_actions);
 
+        // Construct the view for the primary message, hook into it
+        
         Geary.RFC822.Message message;
         try {
             message = email.get_message();
@@ -318,10 +320,11 @@ public class ConversationEmail : Gtk.Box {
             email.load_remote_images().is_certain()
         );
         connect_message_view_signals(this.primary_message);
+
         this.primary_message.summary_box.pack_start(
             this.action_box, false, false, 0
         );
-
+        
         Gtk.Builder builder = new Gtk.Builder.from_resource(
             "/org/gnome/Geary/conversation-email-menus.ui"
         );
@@ -354,7 +357,11 @@ public class ConversationEmail : Gtk.Box {
         //  get_style_context().add_class("geary_sent");
         // }
 
-        // Add sub_messages container and message viewers if there are any
+        pack_start(primary_message, true, true, 0);
+        update_email_state();
+
+        // Add sub_messages container and message viewers if any
+        
         Gee.List<Geary.RFC822.Message> sub_messages = message.get_sub_messages();
         if (sub_messages.size > 0) {
             this.primary_message.body_box.pack_start(
@@ -368,9 +375,6 @@ public class ConversationEmail : Gtk.Box {
             this.sub_messages_box.pack_start(attached_message, false, false, 0);
             this._attached_messages.add(attached_message);
         }
-
-        pack_start(primary_message, true, true, 0);
-        update_email_state();
     }
 
     /**
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index 690053f..cf58fa5 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -1154,16 +1154,14 @@ public class ConversationMessage : Gtk.Box {
         // Work out the link's position, update the popover.
         Gdk.Rectangle link_rect = Gdk.Rectangle();
         web_view.get_allocation(out link_rect);
-        link_rect.x += (int) element.get_offset_left();
-        link_rect.y += (int) element.get_offset_top();
-        WebKit.DOM.Element? offset_parent = element.get_offset_parent();
+        WebKit.DOM.Element? offset_parent = element;
         while (offset_parent != null) {
-            link_rect.x += (int) offset_parent.get_offset_left();
-            link_rect.y += (int) offset_parent.get_offset_top();
-            offset_parent = offset_parent.get_offset_parent();
+            link_rect.x += (int) offset_parent.offset_left;
+            link_rect.y += (int) offset_parent.offset_top;
+            offset_parent = offset_parent.offset_parent;
         }
-        link_rect.width = (int) element.get_offset_width();
-        link_rect.height = (int) element.get_offset_height();
+        link_rect.width = (int) element.offset_width;
+        link_rect.height = (int) element.offset_height;
         link_popover.set_pointing_to(link_rect);
 
         link_popover.show();


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