Commit graph

2603 commits

Author SHA1 Message Date
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
Michael James Gratton
069c2a8eb0 Remove some unused web view font code.
* src/client/conversation-viewer/conversation-web-view.vala
  (ConversationWebView): Don't bother listening to document_font_changed
  since that is handled by StylishWebView.

* src/client/components/stylish-webview.vala: Remove unused signals and
  the interface font property - no longer used.
2016-10-04 10:58:17 +11:00
Michael James Gratton
b121838f83 Re-enable replying to and quoting the selected message, if any. 2016-10-04 10:58:17 +11:00
Michael James Gratton
edf1bb1907 Remove redundant Geary.Email arg from ConversationEmail signals.
Since the ConversationEmail instance is also passed to signal handlers
and the view's email instance can be obtained from that, also passing the
email instance is redundant. Don't do that.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail): Remove Geary.Email from signals where
  present. Also rename ::mark_email_from to ::mark_email_from_here to
  make its operation a bit more obvious. Update call sites and handler
  implementations.
2016-10-04 10:58:17 +11:00
Michael James Gratton
021c3c1554 General clean up of conversation viewer code.
Ensure all public members have semi-decent documentaion comments. Make
public members private if they don't need to be public. Re-org non-public
members to be below public memebers in the source.
2016-10-04 10:58:17 +11:00
Michael James Gratton
eca969e023 Re-enable search highlighting in conversation view.
* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::highlight_search_terms, ConversationViewer::on_reset):
  Move webkit-specific code to ConversationMessage, invoke each message view
  in each email view to update its highlighting.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail): Rename conversation_messages to attached_messages,
  make it a RO public property so the viewer can access it, use a private
  shadown property otherwise.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationMessage): Add methods for highlighting/unmarking search
  terms.
2016-10-04 10:58:17 +11:00
Michael James Gratton
5283b0354d Chase recent master ConversationViewer search changes. 2016-10-04 10:58:17 +11:00
Michael James Gratton
b97d327ac9 Ensure collapsed conversation email attachment button isn't sensitive. 2016-10-04 10:58:17 +11:00
Michael James Gratton
12e64b4a3a Fix alignment of conversation message date and preview date alignment. 2016-10-04 10:58:17 +11:00
Michael James Gratton
a97a371826 Update message header layout, use GtkFlowBox for addresses.
This takes some inspiration from the GNOME Mail mockups.

* src/client/components/main-window.vala (MainWindow::set_styling): Work
  around GtkFlowBoxChild padding issue.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage): Updated to populate new header labels, add
  addresses to GtkFlowBoxes.

* ui/conversation-message.ui: Make date always visible and
  right-aligned. Remove label for sender address. Use GtkFlowBoxes for
  sender/to/cc/bcc.
2016-10-04 10:58:17 +11:00
Michael James Gratton
6253001c4c Don't ever collapse the last email in the conversation. 2016-10-04 10:58:17 +11:00
Michael James Gratton
b9b4114a74 Fix build after rebasing to current master. 2016-10-04 10:58:17 +11:00
Michael James Gratton
4daf4bdcd5 Chase ConversationEmail action namespace change in its main UI file. 2016-10-04 10:58:17 +11:00
Michael James Gratton
57ea807c92 Chase Yorba -> SFC copryright assignment change. 2016-10-04 10:58:17 +11:00
Michael James Gratton
fa47465308 Mark ConversationMessage.context_menu_element as nullable. 2016-10-04 10:58:17 +11:00
Michael James Gratton
5c88e07af6 Re-enable items in the ConversationEmail menu.
Using "msg" for the ConversationMessage context menu action namespace
stopped ConversationEmail's actions being found, so use "eml" instead.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail::ConversationEmail): Use a the "eml" namespace for
  email actions to avoid namespace collision.

* ui/conversation-email-menus.ui: Chase namespace change.
2016-10-04 10:58:17 +11:00
Michael James Gratton
0544a7b93c Namespace a Geary GTK+ theme CSS class. 2016-10-04 10:58:17 +11:00
Michael James Gratton
12b005f08c Turn down some warnings the user can't do anything about. 2016-10-04 10:58:17 +11:00