Commit graph

54 commits

Author SHA1 Message Date
Michael Gratton
de6ef699de Clean up attachment save code
Create new Application.AttachmentManager class and move code for saving
attachments there from both Application.Controller and MainWindow since
aside from needing the latter for dialogs it is independent of both.

Create new Components.AttachmentPane widget for diplaying attachents
for an email in the ConversationViewer.

Update ConversationEmail and ConversationMessage to use these two new
classes directly, rather than implementing save management itself or
requiring the MainWindow to wire up signals on these classes.
2019-11-07 11:58:55 +11:00
Michael Gratton
6234405e4f Merge branch 'wip/geary-inspector' into 'mainline'
Add an Inspector to Geary

See merge request GNOME/geary!199
2019-04-08 09:26:05 +00:00
Michael Gratton
433215570b Make generic account editor ListBoxRow style reusable elsewhere 2019-04-08 18:05:03 +10:00
Michael Gratton
ffaa43cbfe Tweak spoofed email warning UI 2019-04-08 10:26:04 +10:00
Michael Gratton
10051e0354 Implement spoofed email address UI for ContactsPopover 2019-04-08 10:26:04 +10:00
Michael Gratton
680f46c77a Add initial contact popover UI and implementation 2019-04-08 10:22:58 +10:00
Michael Gratton
8f04e4cc36 Fix switches in the accounts editor looking squashed
Don't apply CSS padding to all image widget descendants of an editor row
since switches and other stock widgets also use them internally.

Fixes #299
2019-03-30 15:40:50 +11:00
Michael Gratton
8d17354740 Tidy up placeholder style when it has no text 2019-02-02 13:03:45 +11:00
Michael Gratton
ee8383a001 Show a placeholder when an email body was not able to be loaded 2019-02-02 12:39:31 +11:00
Michael Gratton
bd960dcaf5 Make EmptyPlaceholder more generally useful and rename to fit style 2019-01-21 10:29:15 +10:30
Michael Gratton
e9e4e8a277 Make loading conversations olive-buttery smooth
Remove the first/last child hacks from ConversationListBox since the
GTK+ fix for :first-class and :last-class landed in early 3.22.x
releases. Ensure the first expanded email is properly size-allocated
before loading others, that it remains unmoving in the list as other
rows are added, add a loading bar above it when there are more email to
load below it.
2019-01-20 11:44:28 +10:30
Michael Gratton
36cfa14689 Reducing padding in conversation viewer list 2019-01-15 12:21:03 +11:00
Michael Gratton
d7a388aebb Fix backgroud colour of insensitive account editor row entry background 2018-12-26 12:16:29 +10:30
Michael Gratton
cf73a91681 Hide add account text entry borders
Cromulence++
2018-12-20 14:10:38 +11:00
Michael Gratton
f630e03485 Add some polish to account edditor list drag and drop
Paint the row that was picked up as the drag icon, dim the actual row
and don't highlight it when dragging over itself.

Icon drawing code courtesy ebassi's tutorial:
https://blog.gtk.org/2017/04/23/drag-and-drop-in-lists/
2018-12-02 15:16:07 +11:00
Michael Gratton
9aab053382 Implement initial drag and drop for accounts, sender mailbox ordering
Code courtesy @ebassi's tutorial:
https://blog.gtk.org/2017/04/23/drag-and-drop-in-lists/
2018-12-02 15:15:58 +11:00
Michael Gratton
143da15bb2 Update UI for accounts editor servers pane
This is close to something that would work as an initial
implementation.
2018-11-30 23:49:30 +11:00
Michael Gratton
bb629999a6 Implement decent keyboard nav for AccountsEditor and editor panes
Return to previous panes using escape/back/(left|right), navigate
between settings list items using up/down.

Implementation courtesy
https://blogs.gnome.org/mclasen/2014/02/27/getting-the-details-right/
2018-11-30 23:49:30 +11:00
Michael James Gratton
b8213b5b86 Add initial replacement account creation pane. 2018-11-30 23:49:30 +11:00
Michael James Gratton
d9b94c1c61 Implement editing for the account editor pane. 2018-11-30 23:49:30 +11:00
Michael James Gratton
688040663a Add initial replacement account server details pane. 2018-11-30 23:49:30 +11:00
Michael James Gratton
2f0a7b9c18 Add initial replacement account editor pane. 2018-11-30 23:49:30 +11:00
Michael James Gratton
05be1c1014 Add initial replacement accounts editor dialog. 2018-11-30 23:49:30 +11:00
Michael James Gratton
07b4a7842f Replace some deprecated style calls in the composer with CSS rules. 2018-04-15 22:03:35 +10:00
Michael James Gratton
cba778d6f7 RTL UI fixes for ConversationMessage. 2017-12-12 15:56:31 +11:00
Michael James Gratton
80680f280e Add initial support for using Gtk.InfoBars to display errors.
* src/client/components/main-window-info-bar.vala (MainWindowInfoBar):
  New class and UI file for displaying an info bar in the main window, as
  well as providing a way to show technical informartion if needed.

* src/client/components/main-window.vala (MainWindow): Add a Gtk.Frame
  and container to hold inforbar instances. Show it when showing an
  infobar, and hide it when there are none. Add show_infobar() method to
  provide a cromulent way of adding info bars.

* src/client/application/geary-controller.vala (BaseObject): Rather than
  bailing out on an account when an error occurs, display an info bar
  instead.

* ui/geary.css: Style the info bar frame to only show a border between
  main content and the info bars.
2017-11-12 22:18:51 +11:00
Michael James Gratton
bd7f2d1d4c Remove most of the remaining workarounds for earlier GTK versions. 2017-10-10 14:32:50 -07:00
Michael James Gratton
928189f36d Fix matching message subject not being highlighted in find/search.
Bug 778033

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage::highlight_search_terms): Also check the subject
  for matching items and highlight if found.

* src/client/conversation-viewer/conversation-list-box.vala
  (ConversationListBox::EmailRow): Update matching row class to
  disambiguate from matching headers.

* ui/geary.css: Ensure matching subject labels get highlighted.
2017-02-23 11:33:12 +11:00
Michael Gratton
d6466d5747 Fix GTK+ widget style issues under GTK+ < 3.20. 2016-12-09 13:31:03 +11:00
Michael James Gratton
3ef1ac973e Fix runtime errors when built/running against GTK +3.14.
* ui/conversation-viewer.ui,
  src/client/conversation-viewer/conversation-viewer.vala: next-match and
  previous-match signals are only available in GTK+ >= 3.16.

* ui/empty-placeholder.ui: Drop declared GTK+ requirement to 3.14.

* ui/geary.css: The :not() pseudeo class is only available in GTK+ >= 3.20.
2016-12-06 16:22:39 +11:00
Michael James Gratton
65e0df7aca Update conversation address labels to indicate interactivity. Bug 765516.
* src/client/conversation-viewer/conversation-message.vala
  (AddressFlowBoxChild::AddressFlowBoxChild): Check for enter and leave
  events, update the prelight state of the flowbox child accordingly.
  (ConversationMessage::on_address_box_child_activated): Update the
  active state of the flowbox child appropriately when the popover
  active.

* ui/geary.css: Style the active and hover states of the flowboxes.
2016-10-08 17:32:40 +11:00
Michael James Gratton
dfe9e3d43a Fix secondary address label parts not being dim under the Arc theme.
Replace the dim-label hack with two distinct labels, themed using GTK CSS
classes.

Bug 765516.

* src/client/conversation-viewer/conversation-message.vala
  (AddressFlowBoxChild::AddressFlowBoxChild): Construct a different
  Gtk.Label for each address part, add CSS classes to enable them to be
  styled. Pass an enum in to specify From addresses, rather than Pango
  markup attr values. Fix call sites. Remove now obsolete
  ::format_address() method, update call sites.

* src/client/util/util-gtk.vala (pango_color_from_theme): Remove now
  unsed method.

* ui/geary.css: Style the new address labels.
2016-10-08 17:29:54 +11:00
Michael James Gratton
8cde4f36a2 Split up handling of emails and composers in conversation list box.
* src/client/conversation-viewer/conversation-listbox.vala: Add two
  different listbox child row types, one for emails only and one for
  composers only, with a common ConversationRow superclass. When a draft
  composer is added, replace the draft email it is standing in for, and
  replace it again when removed. Rename last_email_row to last_row and
  make into a generic ConversationRow, only update it at the end of a
  batch of changes.
2016-10-04 10:58:17 +11:00
Michael James Gratton
23fdf583cf Don't show draft messages when editing them.
* src/client/conversation-viewer/conversation-listbox.vala (EmailRow):
  Add a grid to the row, then add the email view to that. Allow embedded
  composers to also be added to the grid, hide the email view when the
  composer is for a draft. Fix code making asumptions about EmailRow's
  child.
  (ConversationListBox::add_embedded_composer): Add draft param, pass it
  through to the email row. Update call sites.

* src/client/conversation-viewer/conversation-email.vala
  (ConversationEmail): Remove composer related prop and methods, since
  its handled by EmailRow now.

* ui/geary.css: Update widget hierarchy.
2016-10-04 10:58:17 +11:00
Michael James Gratton
d217cb868f Highlight search terms in conversation message address headers. 2016-10-04 10:58:17 +11:00
Michael James Gratton
99e0f689a8 Highlight unread emails in convo viewer. 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
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
9eafaaae4a Reduce spacing between messages in the conversation list. 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
dcc5f42eea Tidy up conversation list style. 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
ec22b33825 Reenable displaying sub-messages.
Geary currently displays RFC 822 attachments inline, below the email's
primary message body, using the same HTML chrome for the headers and
email body as for the primary body. Taking the same approach but using
GTK+ widgets meant splitting ConversationMessage up into a
ConversationEmail class that manages the UI for displaying an email in
its entirety, and a ConversationMessage to manage the only header widgets
and webview for displaying an individual RFC 822 message, usable for both
the primary body and any sub-messages. Thus, this is a big change.

One behavioural change is that each sub-message with remote images now
requires individual approval, rather than being dependant on the
containing message's sender and/or approval. This prevents some attacks
e.g. a trusted sender forwarding a spam/malware message, but does not
prevent it if the message is forwarded inline, obviosuly.

* src/client/conversation-viewer/conversation-email.vala (ConversationEmail):
  New class for managing the UI for an overall email message. This
  replaces the old ConversationMessage and contains much of it's code and
  widgets - anything from that class which does not directly support
  displaying headers or a message body.

* src/client/conversation-viewer/conversation-message.vala:
  (ConversationMessage): Same class as before, but now with its scope
  narrowed to only display message headers and body. The draft infobar
  remains here rather than being put ConversationEmail where it belongs
  since it's bit of a pain to insert in the right place and doesn't
  really hurt.
  (::email): Moved this property and any code that depends on it to
  ConversationEmail.
  (::always_load_remote_images): New property passed in via the ctor,
  allowing one dependency on the old ::email property to be removed.
  (::inlined_content_ids): Moved to ConversationEmail, since that is the
  class that keeps track of attachments to display. Add the signal
  attachment_displayed_inline to allow ConversationEmail to be notified
  of inlined attachments instead.
  (::flag_remote_images, ::remember_remote_images): New signals to notify
  ConversationEmail that the user has flagged this message or the
  message's sender for loading remote images. This is passed through
  since in the former's case we may need to set flags on the email
  itself, the latter because it is one less use of the contact_store
  property, which should be removed from this class at some point.

* src/client/conversation-viewer/conversation-viewer.vala: Chase API
  changes from the above. In general, replace use of the term "message"
  with "email" since this class is now mostly dealing with
  ConversationEmail instances, rather than ConversationMessage instances.
  (ConversationViewer::check_mark_read): Only consider the
  ConversationEmail's primary message body when checking for visibility
  rather than that and any submessages to keep things simple.
  (ConversationViewer::show_message, ::hide_message): Renamed to
  expand_email/collapse_email respectively since we don't ever actually
  hide it. Carry that change on to same methods on ConversationEmail.

* src/engine/rfc822/rfc822-message.vala (Geary.RFC822.Message): Add
  get_primary_originator(), almost vermatim from Geary.Email, to support
  determining the sender for remembering remote message loading for
  senders of sub-emails.

* src/client/components/main-window.vala (MainWindow::set_styling): Fix
  background transition for collapsed emails.

* src/client/application/geary-controller.vala: Chase API name changes.

* src/CMakeLists.txt: Include new ConversationEmail source file.

* ui/conversation-email.ui: New UI for ConversationEmail, move the email
  action box, attachments box amd sub-messages box here from
  conversation-message.ui.

* ui/CMakeLists.txt: Include new UI in compiled resources.

* po/POTFILES.in: Add new UI for transation.
2016-10-04 10:58:17 +11:00
Michael James Gratton
9e7fee035a Tidy up ConversationMessage styling and state management.
* src/client/components/main-window.vala: Adjust theme CSS style to
  account for new widget classes. Fix style for last row in the convo
  listbox.

* src/client/conversation-viewer/conversation-message.vala: Decouple
  updating message state and updating message flags. Prefix CSS classes
  with "geary_" to prevent class name clashes.

* src/client/conversation-viewer/conversation-viewer.vala: Manually
  maintain a CSS class on the last row of the convo listbox to work
  around Bug 764710. Prefix CSS classes with "geary_" to prevent class
  name clashes.
  (ConversationViewer::on_update_flags): Renamed from update_flags since
  it is only ever called as a signal handler. Remove most of the work -
  it is now done by ConversationMessage.
2016-10-04 10:58:17 +11:00
Michael James Gratton
83457ca048 Make collapsed ConversationMessage message boxes a bit lighter. 2016-10-04 10:58:17 +11:00
Michael James Gratton
89a1dc8c88 Style the ConversationViewer user message with CSS rather than a class. 2016-10-04 10:58:17 +11:00
Michael James Gratton
d0dc003772 Clean up message header UI, tranitions and style a bit.
* ui/conversation-message.ui: Split out preview labels from existing
  header box and create a new preview box for them.

* src/client/components/main-window.vala (MainWindow::set_styling): Use
  style-defined names to allow us to specify message row backgrounds better.

* src/client/conversation-viewer/conversation-message.vala
  (ConversationMessage): Update GTK composite template children
  properties and visible state when showing/hiding the body, set new
  preview/header box label texts.

* src/client/conversation-viewer/conversation-viewer.vala
  (ConversationViewer::do_embedded_composer,
  ConversationViewer::add_message): Don't add 'frame' class to conversation
  list rows, we're styling it explicitly now.
2016-10-04 10:58:17 +11:00
Michael James Gratton
22e67655ac Reenable and update code for inline message image display.
Use a GtkInfoBar to display to the user the message and related buttons
instead of the message-inline HTML approach. Still needs some additional
work to save per-message loading and displaying images from same sender
in convo when "Always Show" is chosen.

* src/client/conversation-viewer/conversation-message.vala: Reenable
  remote image related code, remove HTML-based UI management code.

* src/client/components/main-window.vala (MainWindow::set_styling):
  Add some theme CSS to style the remote images infobar.

* ui/conversation-message.ui: Add the remote images infobar.
2016-10-04 10:58:17 +11:00
Michael James Gratton
69a53d9db9 Reenable and update code for embedded message composer.
The embedded composer is now added to the the conversation list
box. Still needs some work to fix focus and scrolling issues, also to
insert the composer in the right place in the list.

* src/client/components/main-window.vala (MainWindow::set_styling):
  Adjust theme CSS to make padding around embedded coposer not so
  terrible. Fix style for embedded headerbar.

* src/client/composer/composer-embed.vala: Don't attempt to up-manage
  it's parent's state, since the parent has a much better idea of how
  best to do that. Instead of passing in a ConversationViewer, just pass
  in a Gtk.ScrolledWindow that needs to be adjusted as the embededded
  editor and add some signals needed by the ConversationViewer. Reenabled
  some code needed to get scroll event passthrough working.

* src/client/conversation-viewer/conversation-viewer.vala: Remove old
  embedded composer code. Adjust conversation_listbox callbacks to handle
  the embedded composer being present.
  (ConversationViewer::get_selected_message): Fixed to actually return a
  message.
  (ConversationViewer::do_embedded_composer): New method to set up an
  embedded composer.

* src/client/application/geary-controller.vala
  (GearyController::create_compose_widget_async): Call new
  ConversationViewer::do_embedded_composer to let it set up a new
  embedded composer when needed.
2016-10-04 10:58:17 +11:00