[geary/wip/765516-gtk-widget-conversation-viewer: 114/207] Don't collapse a conversartion email when it has an attached embedded composer.



commit 5cabcfd3999598c5b8e04251c3c7ef8a20735de5
Author: Michael James Gratton <mike vee net>
Date:   Tue Jul 26 15:09:02 2016 +1000

    Don't collapse a conversartion email when it has an attached embedded composer.

 .../conversation-viewer/conversation-email.vala    |    5 +++++
 .../conversation-viewer/conversation-listbox.vala  |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-email.vala 
b/src/client/conversation-viewer/conversation-email.vala
index 9d789cd..6acc4f7 100644
--- a/src/client/conversation-viewer/conversation-email.vala
+++ b/src/client/conversation-viewer/conversation-email.vala
@@ -147,6 +147,9 @@ public class ConversationEmail : Gtk.Box {
         owned get { return this._attached_messages.read_only_view; }
     }
 
+    /** The embedded composer for this email, if any. */
+    public ComposerEmbed composer { get; private set; default = null; }
+
     // Backing for attached_messages
     private Gee.List<ConversationMessage> _attached_messages =
         new Gee.LinkedList<ConversationMessage>();
@@ -447,6 +450,7 @@ public class ConversationEmail : Gtk.Box {
      * Attach an embedded composer to this email view.
      */
     public void attach_composer(ComposerEmbed embed) {
+        this.composer = embed;
         add(embed);
     }
 
@@ -455,6 +459,7 @@ public class ConversationEmail : Gtk.Box {
      */
     public void remove_composer(ComposerEmbed embed) {
         remove(embed);
+        this.composer = null;
     }
 
     /**
diff --git a/src/client/conversation-viewer/conversation-listbox.vala 
b/src/client/conversation-viewer/conversation-listbox.vala
index a8a5bd8..96ab9da 100644
--- a/src/client/conversation-viewer/conversation-listbox.vala
+++ b/src/client/conversation-viewer/conversation-listbox.vala
@@ -719,7 +719,7 @@ public class ConversationListBox : Gtk.ListBox {
     private void on_row_activated(Gtk.ListBoxRow widget) {
         EmailRow row = (EmailRow) widget;
         if (!row.is_last) {
-            if (row.is_expanded) {
+            if (row.is_expanded && row.view.composer == null) {
                 row.collapse();
             } else {
                 row.expand();


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