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



commit 56684487ce8cc124a2783d91c5efc993b767558a
Author: Michael James Gratton <mike vee net>
Date:   Tue Apr 12 01:15:38 2016 +1000

    Minor code cleanup.
    
    * src/client/components/main-window.vala (ComposerBox): Remove obsolete
      theme CSS.
    
    * src/client/conversation-viewer/conversation-viewer.vala
      (ConversationViewer): Update some comments, re-organise some code.

 src/client/components/main-window.vala             |    5 -----
 .../conversation-viewer/conversation-viewer.vala   |   13 ++++++-------
 2 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index 3ad22b2..0ec1dda 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -168,11 +168,6 @@ public class MainWindow : Gtk.ApplicationWindow {
                 border-bottom-width: 0;
             }
 
-            ComposerEmbed GtkHeaderBar,
-            ComposerBox GtkHeaderBar,
-            GtkBox.vertical GtkHeaderBar {
-                border-radius: 0px;
-            }
             .geary-titlebar-left:dir(ltr),
             .geary-titlebar-right:dir(rtl) {
                 border-top-right-radius: 0px;
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index f0d54d8..f05d290 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -106,11 +106,11 @@ public class ConversationViewer : Gtk.Stack {
     [GtkChild]
     private Gtk.Label user_message_label;
 
-    // List of emails in this view.
+    // Sorted set of emails being displayed
     private Gee.TreeSet<Geary.Email> messages { get; private set; default = 
         new Gee.TreeSet<Geary.Email>(Geary.Email.compare_sent_date_ascending); }
     
-    // Maps emails to their corresponding ListBoxRow.
+    // Maps displayed emails to their corresponding ListBoxRow.
     private Gee.HashMap<Geary.EmailIdentifier, Gtk.ListBoxRow> email_to_row = new
         Gee.HashMap<Geary.EmailIdentifier, Gtk.ListBoxRow>();
     
@@ -568,11 +568,10 @@ public class ConversationViewer : Gtk.Stack {
     }
     
     private void add_message(Geary.Email email, bool is_in_folder) {
-        // Ensure the message container is showing and the multi-message counter hidden.
-        set_visible_child(conversation_page);
-        
-        if (messages.contains(email))
+        if (messages.contains(email)) {
             return;
+        }
+        messages.add(email);
 
         ConversationMessage message = new ConversationMessage(email, current_folder);
         message.link_selected.connect((link) => { link_selected(link); });
@@ -587,9 +586,9 @@ public class ConversationViewer : Gtk.Stack {
         row.get_style_context().add_class("frame");
         row.show();
         row.add(message);
+
         conversation_listbox.add(row);
 
-        messages.add(email);
         email_to_row.set(email.id, row);
 
         if (email.is_unread() == Geary.Trillian.TRUE) {


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