Commit graph

2620 commits

Author SHA1 Message Date
Michael James Gratton
9c813eaacb Replace Gtk.IconView with FlowBox for displaying email attachments. 2016-10-04 10:58:17 +11:00
Michael James Gratton
a2644f243a Fix missing space between message avatar and headers. 2016-10-04 10:58:17 +11:00
Michael James Gratton
4b862dc470 Fix compile error. 2016-10-04 10:58:17 +11:00
Michael James Gratton
9953ef3235 Fix massive memory leak due to some convo widgets never being freed. 2016-10-04 10:58:17 +11:00
Michael James Gratton
580f1b921e Fix 0px elements being rendered as 1px boxes. 2016-10-04 10:58:17 +11:00
Michael James Gratton
b03c0add14 Convert new convo widgets to use Gtk.Grid instead of Box. 2016-10-04 10:58:17 +11:00
Michael James Gratton
599da42d18 Move managing toolbar mesage buttons from convo viewer to controller.
* src/client/application/geary-controller.vala (GearyController): Update
  message button state when updating ConversationViewer state.
  (GearyController::on_conversations_selected): Move logic for handling
  different numbers of selected conversations from ConversationViewer
  here, so that message button state can be updated when the selection
  count changes.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer): Add ::is_composer_visible property, methods for
  showing empty/muiple conversations selected UI.
2016-10-04 10:58:17 +11:00
Michael James Gratton
edf1bf01d3 Fix inline JPEGs being corrupted when converted to data URIs.
* src/engine/rfc822/rfc822-message.vala (mime_part_to_memory_buffer):
  Only do text processing on a part's stream if UTF-8 is requested.
2016-10-04 10:58:17 +11:00
Michael James Gratton
f3f22ca5d3 Fix some inline parts not being visible.
* src/client/conversation-viewer/conversation-email.vala
  (load_attachments): Check for attachment and inline elements that have
  not been included inline and add them as attachments.

* src/engine/rfc822/rfc822-message.vala (construct_body_from_mime_parts):
  Only pass parts marked as inline to the inline replacer.
2016-10-04 10:58:17 +11:00
Michael James Gratton
640e8fdbc6 Workaround wide convo InfoBars being too wide for small screens.
* ui/conversation-email.ui, ui/conversation-message.ui: Ellipsie labels
  on InfoBars so they can shrink.
2016-10-04 10:58:17 +11:00
Michael James Gratton
425c60e0a1 Don't clobber avatar loads for second and subsequent convo loads.
* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::load_conversations): Cancel existig loads before
  launching new avatar loads.
2016-10-04 10:58:17 +11:00
Michael James Gratton
49d3b82440 Minor code cleanup. 2016-10-04 10:58:17 +11:00
Michael James Gratton
7f3baa76b5 Fix most conversation web view height issues.
* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage): Remove ::is_loading_complete prop since it was
  neveer accurate, replace uses with ConversationWebView::is_height_valid
  instead. Hook up unset_controllable_quotes to web_view.size_allocate so
  quotes and their containers have accurate heights.

* src/client/conversation-viewer/conversation-web-view.vala
  (ConversationWebView): Make ::is_height_valid a property in case we
  want to get notify events about it in the future. Don't use an arbirary
  max hieght to determine if the HTML's height is valid, use what it
  thinks its width is instead.
2016-10-04 10:58:17 +11:00
Michael James Gratton
a7570f88f2 Ensure conversation messages min width is low enough for small screens.
* src/client/conversation-viewer/conversation-message.vala
  (AddressFlowBoxChild): Enable ellipsizing the label. Set the alignment
  so labels are correctly aligned at narrow widths. Removed some cruft.

* ui/conversation-message.ui: Ensure long words in subject are
  wrapped. Ensure there's always at least two cols for recipient address
  flow boxes.
2016-10-04 10:58:17 +11:00
Michael James Gratton
9c587bbc6f Always allow last messages in a convo to be expanded.
Sent messages will be appended last to a convo when they get synced, so
they should be able to be expanded.
2016-10-04 10:58:17 +11:00
Michael James Gratton
5ea4b0a051 Prefix CSS classes in message HTML to avoid collisions with HTML messages.
* ui/conversation-web-view.css: Prefix the names of base Geary-internal
  elements with "geary_" to reduce the odds of them colliding with class
  names in HTML messages. Chase the name changes in classes that generate
  them.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage): Use constants for class names and
  WebKit.DOMElement::class_list to add/remove them.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b5e7c27c58 Tidy up collapsible quote container style and behaviour.
* src/client/conversation-viewer/conversation-message.vala:
  (ConversationMessage::create_quote_container): Fix unwanted whitespace
  at the top of quote containers by removing newlines from the inner
  HTML used to construct them.
  (ConversationMessage::unset_controllable_quotes): Replace using
  absolute pxiel value for determining whether a quote should be unhidden
  with a percentage of the parent container.

* ui/conversation-web-view.css: Polish and simplify quote container CSS.
2016-10-04 10:58:17 +11:00
Michael James Gratton
18621a2f7f Remove some unused/uneeded message body CSS. 2016-10-04 10:58:17 +11:00
Michael James Gratton
18c83d7bc6 Use app-driven width for conversation web view, not content-driven.
* src/client/conversation-viewer/conversation-web-view.vala: Always
  return 0 as the min/preferred width.
2016-10-04 10:58:17 +11:00
Michael James Gratton
7581f16320 Substantially rework email HTML sanitising and styling.
* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::clean_html_markup): Ensure all displayed message
  bodies have at least a HTML element, so that the style in
  conversation-web-view.css has something to work on. Load application
  style when sanitising the HTML rather than when the web view has
  loaded.

* src/client/conversation-viewer/conversation-web-view.vala
  (ConversationWebView): Just set user style using WebKit.WebSettings,
  don't try to set application CSS, and remove all associated code.

* ui/conversation-web-view.css: Only trigger CSS 2.1 § 10.6.7 on the HTML
  element, so BODY can be styled as normal by email CSS.
2016-10-04 10:58:17 +11:00
Michael James Gratton
c75719cfe7 Port some changes over from master lost in the last rebase. 2016-10-04 10:58:17 +11:00
Michael James Gratton
440368734d Fix some critical warnings during object destruction.
* src/client/conversation-viewer/conversation-message.vala: Always
  release by setting ::context_menu_element to null after use.

* src/client/conversation-viewer/conversation-viewer.vala: Reset
  ::conversation_timeout_id after its callback has completed.
2016-10-04 10:58:17 +11:00
Michael James Gratton
6190079736 Minor conversation viewer code cleanup. 2016-10-04 10:58:17 +11:00
Michael James Gratton
020ebfd2a6 Fix jumpy focus scrolling on emails bigger than the viewport. 2016-10-04 10:58:17 +11:00
Michael James Gratton
579589f944 Make conversation viewer email flag handling a bit more null-safe. 2016-10-04 10:58:17 +11:00
Michael James Gratton
7cc739c61c Don't hide in-window composers just after they are shown. 2016-10-04 10:58:17 +11:00
Michael James Gratton
8cb5971705 Simplify how ConversationListBox removal, explicitly destroy them.
As for the composers in the last commit, manually destroying old lists
lists seems to be required.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b5efee10b1 Fix in-window and in-comversation composers not getting cleaned up.
Calling destroy ensures the composer widget cleans up after itself, maybe
because of the signal handlers added in ConversationViewer::do_compose
and ConversationListBox::add_embedded_composer?
2016-10-04 10:58:17 +11:00
Michael James Gratton
845d31d034 Enable popover for conversation message header addresses.
* src/client/conversation-viewer/conversation-email.vala: Hook up new
  ConversationMessage.link_activated signal, ensure sub-messages also
  have their signals hooked up.

* src/client/conversation-viewer/conversation-message.vala: Add a new
  AddressFlowBoxChild inner class for message header addresses. Add new
  signal for emitting link clicks for both actions and the web view. Make
  link-related actions require a string target, update menu construction
  to supply them to the context menu and callbacks expect them. Add a
  popover for header addresses for copying/pasting each address.
2016-10-04 10:58:17 +11:00
Michael James Gratton
6af28fed41 Tidy up ConversationMessage GTK theme CSS. 2016-10-04 10:58:17 +11:00
Michael James Gratton
92603dd61f Minor conversation code cleanup. 2016-10-04 10:58:17 +11:00
Michael James Gratton
4d02eecfd5 Fix logic error when determining when to show the "show images" infobar. 2016-10-04 10:58:17 +11:00
Michael James Gratton
a3dd8f836c Minor conversation code cleanup. 2016-10-04 10:58:17 +11:00
Michael James Gratton
5cabcfd399 Don't collapse a conversartion email when it has an attached embedded composer. 2016-10-04 10:58:17 +11:00
Michael James Gratton
93e8a148dc Add a tooltip to to conversartion viewer's date headers with full date. 2016-10-04 10:58:17 +11:00
Michael James Gratton
b56e84fa2c Gracefully handle messages with no from address in conversation viewer. 2016-10-04 10:58:17 +11:00
Michael James Gratton
d467647153 Break out ListBox used to display conversations into standalone widget.
The conversation viewer's ListBox is sufficiently complex to warrant its
own widget. Use empty placeholders for the list per the HIG, and
correctly fix mamagement of empty folder vs no conversations selected
this time.

* src/client/application/geary-controller.vala (GearyController):
  Directly manage secondary parts of the conversation viewer, since the
  controller since it has a better and more timely idea of when a
  conversation change is due to folder loading status or from the user
  selecting conversations, and so the viwer doesn't need to hook back
  into the controller. Remove the now-unused conversations_selected
  signal and its callers.

* src/client/conversation-viewer/conversation-listbox.vala: New widget
  for displaying the list of emails for a conversation. Moved relevant
  code from ConversationViewer here. Made adding emails async to get
  better UI responsiveness. Don't implement anything to handle
  conversation changes or emptying the list.

* src/client/conversation-viewer/conversation-viewer.vala: Replace user
  messages - empty folder/search & no/multiple messages selected with new
  EmptyPlaceholder. Remove a lot of the state manage code needed when
  managing the email listbox. Add a new ConversationListBox for every new
  conversation and just throw away.

* src/client/conversation-list/conversation-list-view.vala
  (ConversationListView): Clean up firing the conversations_selected
  signal - don't actually emit it when the model is clearing, and don't
  bother delaying the check either.

* src/client/components/empty-placeholder.vala: New widget for displaying
  empty list and grid placeholders per the HIG.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail): Make manually read a property, since it
  effectively is one.

* src/CMakeLists.txt: Include new source files.

* po/POTFILES.in: Include new source and UI files, and some missing ones.

* ui/CMakeLists.txt: Include new UI files.

* ui/conversation-viewer.ui: Replace user message and splash page with
  placeholders for the new empty placeholders(!).

* ui/empty-placeholder.ui: UI def for new widget class.

* ui/geary.css: Chase widget name/class changes, style new
  empty placeholder UI.
2016-10-04 10:58:17 +11:00
Michael James Gratton
9f1854548d Scroll to a useful location when a conversation is first loaded.
Scrolls to the first expanded row (first unread, or last email) in the
conversation list box to the top when the convo is fully loaded. To
implement this cleanly, ConversationViewer's handling of ListBoxRows was
cleaned up significantly by introducing a custom subclass and moving
related funtionality there.

* src/client/conversation-viewer/conversation-viewer.vala (EmailRow): New
  class for managing expanded and last row state, events needed to ensure
  we can robustly scroll to the row after its message has been loaded.
  (ConversationViewer::scroll_to_top): New method for scrolling to a
  specific row.
  (ConversationViewer::update_last_row): New method for correctly
  updating the last_email_row property and the row's flags. Replace
  existing ad-hoc methods of determining the last row and ensure that the
  last_email_row is used instead.
  (ConversationViewer::select_conversation_async): Find the first
  expanded row in the newly loaded conversation, and wire it up so that
  it is scrolled to when the email body is eventually loaded, and the
  resulting size reallocations have taken place.

* src/client/conversation-viewer/conversation-web-view.vala
  (ConversationWebView::is_height_valid): Allows checking if the web
  view's height is considered to have been correctly calculated.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b2b216e4bc Fix a crash when viewer is cleared while highlighting search terms. 2016-10-04 10:58:17 +11:00
Michael James Gratton
f7f350c235 Re-enable message view zoom. 2016-10-04 10:58:17 +11:00
Michael James Gratton
48e2b4ee84 Add support for easier iterating over conversation email and msg views. 2016-10-04 10:58:17 +11:00
Michael James Gratton
648e726c86 Ensure header buttons are not sensitive when convo email is collapsed. 2016-10-04 10:58:17 +11:00
Michael James Gratton
1c6745256e Emulate browser-style scroll-on-spacebar. 2016-10-04 10:58:17 +11:00
Michael James Gratton
6009916e0b Fix build after rebase. 2016-10-04 10:58:17 +11:00
Michael James Gratton
9eafaaae4a Reduce spacing between messages in the conversation list. 2016-10-04 10:58:17 +11:00
Michael James Gratton
141099d393 Make conversation ListBox activate and sort call lambdas full methods. 2016-10-04 10:58:17 +11:00
Michael James Gratton
48a45cccd4 Ensure embedded composer is always located below its referred message. 2016-10-04 10:58:17 +11:00
Michael James Gratton
911e81a907 Go back to using the same size avatar for expanded/collapsed messages. 2016-10-04 10:58:17 +11:00
Michael James Gratton
f93fb43d64 Show/hide any attached messages as the primary message is. 2016-10-04 10:58:17 +11:00
Michael James Gratton
dcc5f42eea Tidy up conversation list style. 2016-10-04 10:58:17 +11:00