diff --git a/src/client/conversation-viewer/conversation-email.vala b/src/client/conversation-viewer/conversation-email.vala index ad2ad953..3582b370 100644 --- a/src/client/conversation-viewer/conversation-email.vala +++ b/src/client/conversation-viewer/conversation-email.vala @@ -18,6 +18,9 @@ [GtkTemplate (ui = "/org/gnome/Geary/conversation-email.ui")] public class ConversationEmail : Gtk.Box { + // This isn't a Gtk.Grid since when added to a Gtk.ListBoxRow the + // hover style isn't applied to it. + /** * Iterator that returns all message views in an email view. */ @@ -176,7 +179,7 @@ public class ConversationEmail : Gtk.Box { private SimpleActionGroup message_actions = new SimpleActionGroup(); [GtkChild] - private Gtk.Box action_box; + private Gtk.Grid actions; [GtkChild] private Gtk.Button attachments_button; @@ -197,10 +200,10 @@ public class ConversationEmail : Gtk.Box { private Gtk.InfoBar not_saved_infobar; [GtkChild] - private Gtk.Box sub_messages_box; + private Gtk.Grid sub_messages; [GtkChild] - private Gtk.Box attachments_box; + private Gtk.Grid attachments; [GtkChild] private Gtk.IconView attachments_view; @@ -321,10 +324,8 @@ public class ConversationEmail : Gtk.Box { ); connect_message_view_signals(this.primary_message); - this.primary_message.summary_box.pack_start( - this.action_box, false, false, 0 - ); - + this.primary_message.summary.add(this.actions); + Gtk.Builder builder = new Gtk.Builder.from_resource( "/org/gnome/Geary/conversation-email-menus.ui" ); @@ -338,9 +339,7 @@ public class ConversationEmail : Gtk.Box { ); this.attachments_menu.attach_to_widget(this, null); - this.primary_message.infobar_box.pack_start( - this.draft_infobar, false, false, 0 - ); + this.primary_message.infobars.add(this.draft_infobar); if (is_draft) { this.draft_infobar.show(); this.draft_infobar.response.connect((infobar, response_id) => { @@ -348,31 +347,29 @@ public class ConversationEmail : Gtk.Box { }); } - this.primary_message.infobar_box.pack_start( - this.not_saved_infobar, false, false, 0 - ); + this.primary_message.infobars.add(this.not_saved_infobar); // if (email.from != null && email.from.contains_normalized(current_account_information.email)) { // // XXX set a RO property? // get_style_context().add_class("geary_sent"); // } - pack_start(primary_message, true, true, 0); + pack_start(this.primary_message, true, true, 0); update_email_state(); // Add sub_messages container and message viewers if any Gee.List sub_messages = message.get_sub_messages(); if (sub_messages.size > 0) { - this.primary_message.body_box.pack_start( - this.sub_messages_box, false, false, 0 + this.primary_message.body.pack_start( + this.sub_messages, false, false, 0 ); } foreach (Geary.RFC822.Message sub_message in sub_messages) { ConversationMessage attached_message = new ConversationMessage(sub_message, contact_store, false); connect_message_view_signals(attached_message); - this.sub_messages_box.pack_start(attached_message, false, false, 0); + this.sub_messages.add(attached_message); this._attached_messages.add(attached_message); } } @@ -653,9 +650,9 @@ public class ConversationEmail : Gtk.Box { // Show attachment widgets. Would like to do this in the // ctor but we don't know at that point if any attachments // will be displayed inline. - attachments_button.show(); - attachments_button.set_sensitive(!this.is_collapsed); - primary_message.body_box.pack_start(attachments_box, false, false, 0); + this.attachments_button.show(); + this.attachments_button.set_sensitive(!this.is_collapsed); + this.primary_message.body.add(this.attachments); // Add each displayed attachment to the icon view foreach (AttachmentInfo attachment_info in displayed_attachments) { diff --git a/src/client/conversation-viewer/conversation-listbox.vala b/src/client/conversation-viewer/conversation-listbox.vala index a334cf2a..5179283b 100644 --- a/src/client/conversation-viewer/conversation-listbox.vala +++ b/src/client/conversation-viewer/conversation-listbox.vala @@ -514,7 +514,7 @@ public class ConversationListBox : Gtk.ListBox { }); ConversationMessage conversation_message = view.primary_message; - conversation_message.body_box.button_release_event.connect_after((event) => { + conversation_message.body.button_release_event.connect_after((event) => { // Consume all non-consumed clicks so the row is not // inadvertently activated after clicking on the // email body. diff --git a/src/client/conversation-viewer/conversation-message.vala b/src/client/conversation-viewer/conversation-message.vala index 6dfefd80..d832a690 100644 --- a/src/client/conversation-viewer/conversation-message.vala +++ b/src/client/conversation-viewer/conversation-message.vala @@ -15,7 +15,7 @@ * embeds at least one instance of this class. */ [GtkTemplate (ui = "/org/gnome/Geary/conversation-message.ui")] -public class ConversationMessage : Gtk.Box { +public class ConversationMessage : Gtk.Grid { // Widget used to display sender/recipient email addresses in // message header Gtk.FlowBox instances. @@ -99,11 +99,11 @@ public class ConversationMessage : Gtk.Box { /** Box containing the preview and full header widgets. */ [GtkChild] - internal Gtk.Box summary_box; + internal Gtk.Grid summary; /** Box that InfoBar widgets should be added to. */ [GtkChild] - internal Gtk.Box infobar_box; + internal Gtk.Grid infobars; /** HTML view that displays the message body. */ internal ConversationWebView web_view { get; private set; } @@ -129,16 +129,16 @@ public class ConversationMessage : Gtk.Box { [GtkChild] private Gtk.Label date; [GtkChild] - private Gtk.Box to_header; + private Gtk.Grid to_header; [GtkChild] - private Gtk.Box cc_header; + private Gtk.Grid cc_header; [GtkChild] - private Gtk.Box bcc_header; + private Gtk.Grid bcc_header; [GtkChild] private Gtk.Revealer body_revealer; [GtkChild] - public Gtk.Box body_box; + public Gtk.Box body; // WebKit.WebView crashes when added to a Grid [GtkChild] private Gtk.Popover link_popover; @@ -306,8 +306,9 @@ public class ConversationMessage : Gtk.Box { this.web_view.selection_changed.connect(on_selection_changed); this.web_view.show(); - this.body_box.set_has_tooltip(true); // Used to show link URLs - this.body_box.pack_start(this.web_view, true, true, 0); + this.body.set_has_tooltip(true); // Used to show link URLs + this.body.pack_start(this.web_view, true, true, 0); + } } /** @@ -564,10 +565,10 @@ public class ConversationMessage : Gtk.Box { return menu; } - private void set_header_addresses(Gtk.Box header, + private void set_header_addresses(Gtk.Grid header, Geary.RFC822.MailboxAddresses? addresses) { if (addresses != null && addresses.size > 0) { - Gtk.FlowBox box = header.get_children().nth(1).data as Gtk.FlowBox; + Gtk.FlowBox box = header.get_children().nth(0).data as Gtk.FlowBox; if (box != null) { set_flowbox_addresses(box, addresses); } @@ -1239,8 +1240,8 @@ public class ConversationMessage : Gtk.Box { // Use tooltip on the containing box since the web_view // doesn't want to pay ball. - this.body_box.set_tooltip_text(this.hover_url); - this.body_box.trigger_tooltip_query(); + this.body.set_tooltip_text(this.hover_url); + this.body.trigger_tooltip_query(); } private void on_selection_changed() { diff --git a/src/client/conversation-viewer/conversation-viewer.vala b/src/client/conversation-viewer/conversation-viewer.vala index 1087c6d7..fc3f61a2 100644 --- a/src/client/conversation-viewer/conversation-viewer.vala +++ b/src/client/conversation-viewer/conversation-viewer.vala @@ -51,17 +51,17 @@ public class ConversationViewer : Gtk.Stack { [GtkChild] private Gtk.Spinner loading_page; [GtkChild] - private Gtk.Box no_conversations_page; + private Gtk.Grid no_conversations_page; [GtkChild] internal Gtk.ScrolledWindow conversation_page; [GtkChild] - private Gtk.Box multiple_conversations_page; + private Gtk.Grid multiple_conversations_page; [GtkChild] - private Gtk.Box empty_folder_page; + private Gtk.Grid empty_folder_page; [GtkChild] - private Gtk.Box empty_search_page; + private Gtk.Grid empty_search_page; [GtkChild] - private Gtk.Box composer_page; + private Gtk.Grid composer_page; private ConversationFindBar conversation_find_bar; @@ -87,36 +87,28 @@ public class ConversationViewer : Gtk.Stack { no_conversations.subtitle = _( "Selecting a conversation from the list will display it here" ); - this.no_conversations_page.pack_start( - no_conversations, true, true, 0 - ); + this.no_conversations_page.add(no_conversations); EmptyPlaceholder multi_conversations = new EmptyPlaceholder(); multi_conversations.title = _("Multiple conversations selected"); multi_conversations.subtitle = _( "Choosing an action will apply to all selected conversations" ); - this.multiple_conversations_page.pack_start( - multi_conversations, true, true, 0 - ); + this.multiple_conversations_page.add(multi_conversations); EmptyPlaceholder empty_folder = new EmptyPlaceholder(); empty_folder.title = _("No conversations found"); empty_folder.subtitle = _( "This folder does not contain any conversations" ); - this.empty_folder_page.pack_start( - empty_folder, true, true, 0 - ); + this.empty_folder_page.add(empty_folder); EmptyPlaceholder empty_search = new EmptyPlaceholder(); empty_search.title = _("No conversations found"); empty_search.subtitle = _( "Your search returned no results, try refining your search terms" ); - this.empty_search_page.pack_start( - empty_search, true, true, 0 - ); + this.empty_search_page.add(empty_search); // Setup state machine for search/find states. Geary.State.Mapping[] mappings = { @@ -165,7 +157,7 @@ public class ConversationViewer : Gtk.Stack { conversation_list_view.select_conversations(prev_selection); } }); - composer_page.pack_start(box); + this.composer_page.add(box); set_visible_child(composer_page); } diff --git a/ui/conversation-email.ui b/ui/conversation-email.ui index a3a7199c..4ce1e99e 100644 --- a/ui/conversation-email.ui +++ b/ui/conversation-email.ui @@ -5,23 +5,20 @@ - + True False end start - True False @@ -40,9 +37,8 @@ - False - False - 0 + 0 + 0 @@ -64,9 +60,8 @@ - False - False - 1 + 1 + 0 @@ -87,9 +82,8 @@ - False - False - 2 + 2 + 0 @@ -110,9 +104,8 @@ - False - False - 3 + 3 + 0 @@ -126,19 +119,20 @@ - + True False + True vertical True False + True - False - False - 0 + 0 + 0 @@ -146,6 +140,7 @@ True True 6 + True multiple horizontal attachments_model @@ -172,9 +167,8 @@ - True - True - 1 + 0 + 1 @@ -327,13 +321,38 @@ button1 - + True False + True vertical + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/conversation-message.ui b/ui/conversation-message.ui index aabfd70f..40134470 100644 --- a/ui/conversation-message.ui +++ b/ui/conversation-message.ui @@ -2,15 +2,16 @@ -