From dcc5f42eeaa2277424efd0169bd42b45a99b7058 Mon Sep 17 00:00:00 2001 From: Michael James Gratton Date: Fri, 8 Jul 2016 11:12:42 +1000 Subject: [PATCH] Tidy up conversation list style. --- .../conversation-email.vala | 2 -- .../conversation-web-view.vala | 4 ++- ui/conversation-email.ui | 8 ++++- ui/conversation-message.ui | 30 ++++--------------- ui/conversation-web-view.css | 25 ++++++++++++---- ui/geary.css | 24 ++++++--------- 6 files changed, 44 insertions(+), 49 deletions(-) diff --git a/src/client/conversation-viewer/conversation-email.vala b/src/client/conversation-viewer/conversation-email.vala index 5115a2c1..caf29b24 100644 --- a/src/client/conversation-viewer/conversation-email.vala +++ b/src/client/conversation-viewer/conversation-email.vala @@ -324,7 +324,6 @@ public class ConversationEmail : Gtk.Box { */ public void expand_email(bool include_transitions=true) { is_collapsed = false; - get_style_context().add_class("geary_show_body"); attachments_button.set_sensitive(true); star_button.set_sensitive(true); unstar_button.set_sensitive(true); @@ -337,7 +336,6 @@ public class ConversationEmail : Gtk.Box { */ public void collapse_email() { is_collapsed = true; - get_style_context().remove_class("geary_show_body"); attachments_button.set_sensitive(false); star_button.set_sensitive(false); unstar_button.set_sensitive(false); diff --git a/src/client/conversation-viewer/conversation-web-view.vala b/src/client/conversation-viewer/conversation-web-view.vala index e3818546..773058d2 100644 --- a/src/client/conversation-viewer/conversation-web-view.vala +++ b/src/client/conversation-viewer/conversation-web-view.vala @@ -79,7 +79,9 @@ public class ConversationWebView : StylishWebView { int preferred_height = 0; if (load_status == WebKit.LoadStatus.FINISHED) { - preferred_height = (int) get_dom_document().get_body().offset_height; + // XXX We need this 12px padding since WK doesn't seem to + // report the bottom margin? + preferred_height = (int) get_dom_document().get_body().scroll_height + 12; } // XXX Currently, for some messages the WebView will report diff --git a/ui/conversation-email.ui b/ui/conversation-email.ui index e28004cf..cad44279 100644 --- a/ui/conversation-email.ui +++ b/ui/conversation-email.ui @@ -146,7 +146,7 @@ True True - 0 + 6 multiple horizontal attachments_model @@ -168,6 +168,9 @@ 1 + True @@ -331,5 +334,8 @@ + diff --git a/ui/conversation-message.ui b/ui/conversation-message.ui index 8ced5e0f..59e4e1bb 100644 --- a/ui/conversation-message.ui +++ b/ui/conversation-message.ui @@ -3,7 +3,6 @@ False diff --git a/ui/conversation-web-view.css b/ui/conversation-web-view.css index cfabae6c..ba2bc600 100644 --- a/ui/conversation-web-view.css +++ b/ui/conversation-web-view.css @@ -6,10 +6,17 @@ * General HTML style. */ -html, body { +html { + /* Disallow changes to HTML style using !important since this it is + needed for sizing the ConversationWebView. */ left: 0 !important; width: 100% !important; + margin: 0 !important; + border: 0 !important; + padding: 0 !important; +} +html, body { /* Trigger CSS 2.1 ยง 10.6.7 to get a shrink-wrapped height. See also ConversationWebView.get_preferred_height */ position: absolute !important; @@ -22,13 +29,15 @@ html, body { } body { - margin: 0 !important; - border: 0 !important; - padding: 0 !important; + /* Allow email style to change the body however. */ + left: 0; + right: 0; + margin: 12px; + border: 0; + padding: 0; color: black; background-color: white; - font: caption; - word-wrap: break-word; + overflow-wrap: break-word; } /* By default, tables reset the font properties to "normal" */ @@ -81,6 +90,10 @@ blockquote { border-left: 3px #aaa solid; } +pre { + white-space: pre-wrap; +} + /** * Message chrome style. */ diff --git a/ui/geary.css b/ui/geary.css index 5996f27a..618f6a31 100644 --- a/ui/geary.css +++ b/ui/geary.css @@ -69,13 +69,11 @@ row.geary-folder-popover-list-row > label { transition: margin 0.1s; } #conversation_listbox > row > box { - background: shade(@theme_base_color, 0.96); + background: @theme_base_color; transition: background 0.25s; } -#conversation_listbox > row:hover > box, -#conversation_listbox > row > box.geary_show_body, -#conversation_listbox > row:hover > box.geary_show_body { - background: @theme_base_color; +#conversation_listbox > row:hover > box { + background: shade(@theme_base_color, 0.96); } #conversation_listbox > row.geary_expand, #conversation_listbox > row.geary_composer { @@ -86,22 +84,18 @@ row.geary-folder-popover-list-row > label { margin-bottom: 0; } -#ConversationMessage { - padding: 12px; +.geary-message .geary-message-summary { + margin: 12px; } -#ConversationMessage .geary-header-label { +.geary-message .geary-header-label { margin-right: 6px; } -#ConversationMessage .geary-headers flowboxchild { +.geary-message .geary-headers flowboxchild { margin: 0; padding: 0; } -#ConversationMessage separator { - margin: 12px 0; -} -#ConversationMessage infobar { - border-radius: 2px; - margin-bottom: 12px; +.geary-submessages .geary-message { + background-image: linear-gradient(rgba(0,0,0,0.2), @bg_color 6px); } #composer_embed headerbar {