[geary/wip/765516-gtk-widget-conversation-viewer: 41/80] Don't display ConversationMessage header boxes when header not present.



commit 8204bf836fe8b0f16229529e98582ddedb9a539f
Author: Michael James Gratton <mike vee net>
Date:   Fri Apr 15 10:05:28 2016 +1000

    Don't display ConversationMessage header boxes when header not present.
    
    * src/client/conversation-viewer/conversation-message.vala
      (ConversationMessage::ConversationMessage): Remove old "empty" theme CSS
      class, just set header boxes to be visible when setting their text.
    
    * ui/conversation-message.ui: Default header box visibility to off.

 .../conversation-viewer/conversation-message.vala  |    6 +-----
 ui/conversation-message.ui                         |    5 -----
 2 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index 9d250d9..28fff94 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -141,19 +141,15 @@ public class ConversationMessage : Gtk.Box {
         set_header_text(from_header, format_addresses(message.from));
         if (message.to != null) {
             set_header_text(to_header, format_addresses(message.to));
-            to_header.get_style_context().remove_class("empty");
         }
         if (message.cc != null) {
             set_header_text(cc_header, format_addresses(message.cc));
-            cc_header.get_style_context().remove_class("empty");
         }
         if (message.bcc != null) {
             set_header_text(bcc_header, format_addresses(message.bcc));
-            bcc_header.get_style_context().remove_class("empty");
         }
         if (message.subject != null) {
             set_header_text(subject_header, message.subject.value);
-            subject_header.get_style_context().remove_class("empty");
         }
         if (message.date != null) {
             Date.ClockFormat clock_format =
@@ -162,7 +158,6 @@ public class ConversationMessage : Gtk.Box {
                 date_header,
                 Date.pretty_print_verbose(message.date.value, clock_format)
             );
-            date_header.get_style_context().remove_class("empty");
         }
 
         message_menubutton.set_menu_model(build_message_menu(email));
@@ -295,6 +290,7 @@ public class ConversationMessage : Gtk.Box {
 
     private static void set_header_text(Gtk.Box header, string text) {
         ((Gtk.Label) header.get_children().nth(1).data).set_text(text);
+        header.set_visible(true);
     }
     
     private MenuModel build_message_menu(Geary.Email email) {
diff --git a/ui/conversation-message.ui b/ui/conversation-message.ui
index 3dcf169..e88210f 100644
--- a/ui/conversation-message.ui
+++ b/ui/conversation-message.ui
@@ -145,7 +145,6 @@
                     </child>
                     <child>
                       <object class="GtkBox" id="to_header">
-                        <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
                           <object class="GtkLabel" id="to_label">
@@ -191,7 +190,6 @@
                     </child>
                     <child>
                       <object class="GtkBox" id="cc_header">
-                        <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
                           <object class="GtkLabel" id="cc_label">
@@ -237,7 +235,6 @@
                     </child>
                     <child>
                       <object class="GtkBox" id="bcc_header">
-                        <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
                           <object class="GtkLabel" id="bcc_label">
@@ -283,7 +280,6 @@
                     </child>
                     <child>
                       <object class="GtkBox" id="subject_header">
-                        <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
                           <object class="GtkLabel" id="subject_label">
@@ -329,7 +325,6 @@
                     </child>
                     <child>
                       <object class="GtkBox" id="date_header">
-                        <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
                           <object class="GtkLabel" id="date_label">


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