Commit graph

756 commits

Author SHA1 Message Date
James Westman
f5b6bd6e7c composer: Do not hide nonempty extended fields
This way, you won't forget about an important field (such as CC) if the
extended fields are hidden.

Fixes #675.
2020-01-21 21:20:45 -06:00
James Westman
d6d6f3dff5 composer: Fix focus when clicking font buttons 2020-01-21 21:12:52 -06:00
James Westman
68881434bf composer: Use ReflowBox widget for toolbar
This new widget replaces the size-allocate hack introduced a few commits ago.
2020-01-21 19:43:37 -06:00
James Westman
d5a5afcc78 composer: More tweaks to match mockups
- Move the attachment button(s) out of the headerbar into the action bar
- Add a cancel button
- Adjust some margins
- Set popover positions to top
- Remove subject from headerbar title to save horizontal space
2020-01-21 19:43:37 -06:00
James Westman
0eed1bb21a composer: Add font buttons to toolbar
This replaces the menu options in the overflow menu with nicer looking, more
discoverable toolbar buttons. They work much the same way as before.
2020-01-21 19:43:37 -06:00
James Westman
aaf172b77f composer: Wrap toolbar when it gets too narrow
This way, the composer fits on even smaller screens than before.

Works by simply listening to the size-allocate signal and changing the
orientation of a box if the allocated width is less than or equal to the
combined width of the two rows.
2020-01-21 19:43:37 -06:00
James Westman
2aff2694b2 composer: Move formatting buttons to new toolbar
Splits the toolbar at the top of the composer into two action
bars at the bottom. One is always visible and contains undo, redo,
spellcheck, a menu, and a button to toggle the other action bar. The
other action bar contains the formatting buttons.

Also cleans up the margins around the fields at the top.

Implemented according to the mockups at
https://gitlab.gnome.org/Teams/Design/app-mockups/raw/master/mail/composer.png
2020-01-21 19:43:37 -06:00
Adrien Plazas
0f907c5754 main-toolbar: Drop the custom styles
Drop the custom titlebar styles as they are not needed since we use
HdyTitleBar, and since they can interfeer with it.
2020-01-17 09:54:41 +01:00
Adrien Plazas
392c134724 Use a HdyTitleBar
Also add the .sidebar style class to the separator to make it still take
the whole height. This will help dropping styling workarounds and ensure
animating the headerbars work well.
2020-01-17 09:54:17 +01:00
Michael Gratton
164f52c5fd Merge branch 'ui-extended-fields' into 'mainline'
composer: Better UI for Cc/Bcc/Reply-To fields

See merge request GNOME/geary!393
2020-01-08 10:08:47 +00:00
James Westman
f6e4109c6e Fix close button in composer
In ccb11359, the composer headerbar was set to have a close button by
default. This caused the reply composer to have a close button that
would close the entire window. This commit reverts that part of
ccb11359.
2020-01-03 23:45:25 -06:00
James Westman
7753d0a7f7 composer: Better UI for Cc/Bcc/Reply-To fields
Implemented according to the mockups at
<https://gitlab.gnome.org/Teams/Design/app-mockups/raw/master/mail/composer.png>.

- Use an animated revealer rather than instantly showing/hiding the
  fields
- Include Cc in the "extended fields"
- Use a toggle button instead of a menu item to show/hide these fields,
  for better discoverability
2020-01-01 19:25:54 -06:00
Chris Heywood
50a1691b2f Add feedback via HUD progress pulse on slow inline image paste 2019-12-06 11:17:12 +01:00
Chris Heywood
eb36fd5929 Highlight destination folder upon conversation DND
Further utilises partially enabled automatic DND. Fixes #422.
2019-11-28 11:33:28 +01:00
Michael Gratton
e99bf29bd5 Break out ConversationMessage link popover into seperate UI file
This reduces the number of widgets to be parsed and constructed when
showing a conversation, improving loading perf a bit for large
conversations.

See #230
2019-11-27 11:17:04 +11:00
Michael Gratton
4b710074fd Use SLIDE_UP transition for ComposerMessage body animantion
This isn't as nifty, but makes the transiton between conversations
less flashy and hence less janky.
2019-11-26 19:37:49 +11:00
Michael Gratton
6c57839ddf Fix remote resource blocking with shared processes
Now that a shared WebKitUserContentManager is shared between web views,
the old "load a JS file when remote resource loading is allowed" doesn't
work any more. Instead, set a variable on the frame's window object
in the web extension notified that a new page has been loaded, and
use that instead.
2019-11-26 19:37:49 +11:00
Michael Gratton
ceb9c9764a Rename ClientWebView to Components.WebView per code style 2019-11-26 14:26:03 +11:00
Michael Gratton
dfe0b5cc76 Update online keyboard shortcuts help
Make it a bit more compact by merging a few one/the other entries,
make labels read better.
2019-11-21 10:00:34 +11:00
Michael Gratton
259ebe50fd Re-implement single key shortcuts as a preference
Add new `single-key-shortcuts` GSetting, Application.Configuration
property and add UI for it in the Preferences window. When enabled,
load in new `single-key-shortcuts.css` file that has the appropriate
bindings. Update bindings to match Google's current set, and update
shortcut help to match.
2019-11-21 02:36:09 +11:00
Michael Gratton
fb1439264a Update MainWindow shortcuts to be keybinding signal based
Use keybinding ("action") signals and a GtkBindingSet to hook up most
of MainWindow's actions to keyboard shortcuts, rather than use
the application to do so. Remove single-key shortcuts, and update
shortcuts used to avoid collisions. Replace "focus conversation list"
action with general navigation between panes.

🚨 Remove MainWindow hack that enabled single key shortcuts to work 🚨
2019-11-21 02:26:05 +11:00
Michael Gratton
e11e2bd279 Convert prefs dialog to a HdyPreferencesWindow
Move it to the Components package, use libhandy preferences widgets
for the UI.
2019-11-20 23:16:55 +11:00
Michael Gratton
93d1ab684b Merge branch 'mjog/docs-update' into 'mainline'
Docs update

See merge request GNOME/geary!367
2019-11-18 11:23:10 +00:00
Michael Gratton
808f040a2f Remove shortcuts from composer tooltips
These are rendundant now that the shortcut overlay exists.
2019-11-18 18:31:59 +11:00
Michael Gratton
08dc98aade Add keyboard shortcut to help for new windows 2019-11-18 18:31:25 +11:00
Michael Gratton
ccb1135961 Show HeaderBar close buttons by default
Only disable under Unity where they aren't desirable.
2019-11-18 15:29:39 +11:00
Michael Gratton
239fdce562 Move MainWindow to Application package
Move MainWindow out of the root namespace and add it to Application,
so it can privately share internal state with the Controller. Rename
the source and UI files to match.
2019-11-17 21:38:33 +11:00
Michael Gratton
c5c36ee9b3 Don't prompt when closing in-main-window composers
Now we have undo support for sending, saving and discarding composers,
don't prompt when closing in-main-window composers in most cases.

It retains prompting for detached composers, since it may not be obvious
how to undo that (although it is supported), also when closing the main
window completely (for the same reason), and when quitting the app.
2019-11-17 20:00:02 +11:00
Michael Gratton
0128d760c0 Clean up how Composer.Widget's presentation mode is updated
Rather than scattering the composer's detached/paned/inline mode all
over the code base, make it settable only by the containers it is
embedded in, since in that's what actually determines it.

This also lets composers be re-added to the main window if needed.
2019-11-17 20:00:02 +11:00
Michael Gratton
44fd56588b Clean up the Composer API
Make ComposerWidget::close method handle a lot more common code,
allowing many handlers to be simplified. Make access for some properties
more private and add accessors as appropriate, replace some "notify is
too hard" singnals with actual notify calls. Rename a few other
properties to better indicate what they do. Reintroduce `is-draft`
argument to ::load so we can accurately determine if we are loading a
draft, and so the `draft_id` param can be removed from the ctor.
Introduce a ::set_enabled method that can be used to disable and hide
the composer before closing it. Rename ::change_compose_type to
::append_to_email and reduce its scope drastically.

Drastically simplify ComposerContainer's API and its implementing
classes, reducing the API surface down to a single method call. Ensure
its properties that could be null are nullable, update call sites.

Remove dead code in all of the above classes, add more API docs.
2019-11-17 20:00:02 +11:00
Michael Gratton
1447d1acbc Minimise DOM changes made by ComposerPageState::cleanContent JS
By overriding ComposerPageState::getHtml to accept a parameter that
supports getting HTML with empty composer parts removed, cleanContent
can simply be made to linkify the page, thus allowing a ComposerWidget
to be re-used multiple times when sending an email.
2019-11-17 20:00:01 +11:00
Chris Heywood
fa430cac5d Improve passing of inline dropped file through to vala !343 2019-11-17 16:40:13 +11:00
Chris Heywood
f8fa4a4630 First changes for supporting drag & dropped and pasted images
See #90 and #304. Work in progress.
2019-11-17 16:40:13 +11:00
Michael Gratton
a5d72891eb Rework action names groups across the client
Introduce a new standard edit action group "edt" for editing actions
such as copy and undo, separate from the "win" window action group, so
that editing actions can be scoped to specific widgets and overridden
by children. Add new Action namespace with sub-namespaces for the
app, win and edt namespaces and move consts from GearyApplication there.
Update call sites and UI files, use consistent approach to setting up
action groups across all classes that use them.
2019-11-08 10:06:48 +11:00
Michael Gratton
5cc92ef964 Move email action handling to ConversationListBox
This allows a single widget to get constructed to handle email actions,
rather than every single ConversationEmail having to do so, and thus
related signals can also be moved to and emitted from
ConversationListBox, so that MainWindow only has to hook up to a single
object's signals for a conversation, not every email in the
conversation.
2019-11-07 11:58:55 +11:00
Michael Gratton
f9cf70cc0e Fix MainWindow shift button detection
Ensure shift button is assumed to be up on both focus in and focus out,
so when e.g. invoking the inspector the button is assumed to be
released. Remove the signal in preference for using notifiy when needed,
and ensure main toolbar state is updated on focus changes as well.
2019-11-07 11:58:55 +11:00
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
fe67993c8e Clean up MainWindow action definitions
Rename action consts and values to better reflect what they do.
2019-11-05 11:35:31 +11:00
Alex Henrie
20284fe29c Remove unused variable urlRegex from ComposerPageState.containsKeywords 2019-10-26 03:02:41 -06:00
Alex Henrie
feed89225f Don't linkify text near a URL that looks like a URL with a bad protocol 2019-10-22 18:53:18 -06:00
Michael Gratton
647ef90cfc Merge branch 'mjog/589-attachment-keyword-check' into 'mainline'
Attachment keyword fixes

Closes #589

See merge request GNOME/geary!334
2019-10-08 22:32:52 +00:00
Michael Gratton
69e3cdf9b5 Fix ComposerPageState::containsAttachmentKeyword
Just use ComposerPageState::htmlToText to get the email's main content
without quotes, not some custom code.
2019-10-07 23:49:12 +11:00
Michael Gratton
a8ef91f3a8 ui/composer-web-view.js: Improve keyword detection
Update ComposerPageState.containsKeywords to split on any punctuation,
not just spaces, so that text like "see the attachment." will get
detected.
2019-10-07 23:48:38 +11:00
Michael Gratton
5732d23e98 ui/composer-web-view.js: Add element blacklist to htmlToText
Update ComposerPageState.htmlToText() to allow ignoring certain elements
if needed. Update tests to test the function directly rather than going
through ComposerPageState.toText().
2019-10-07 23:42:49 +11:00
Michael Gratton
fc799b378b Unmark Inspector test strings as being translatable
Fixes #585
2019-10-07 00:17:48 +11:00
Alex Henrie
52d010bb22 Clean up composer link insertion and deletion
Allow deleting only the selected part of a link, and modify the existing
link instead of inserting a new one if the user didn't select any text.
Also restructure the code to avoid always-true or always-false if
statements.

Fixes #591
2019-10-05 10:25:25 -06:00
Michael Gratton
52c3c42e23 Merge branch 'wip/573-white-on-white-webkitgtk' into 'mainline'
Specify default HTML colours for composer & conversation viewer

Closes #573

See merge request GNOME/geary!309
2019-09-28 13:14:24 +00:00
Michael Gratton
de6071ef60 Remove Play Sounds preference
This no longer makes sense since we don't have control over it for
notifications any more, and hence was only being used for sent mail.

Replace it with a NotificationContext signal so that a plugin could be
written to play a sound instead.
2019-09-27 20:42:58 +10:00
Michael Gratton
c7c135ce5b Remove notifications preference now it is unused 2019-09-27 19:53:58 +10:00
Michael Gratton
d5e7c05cba Move InAppNotification class to components package
It was the last class left in notifications, so not much point keeping
it there. Also take the opportunity to add it to a package proper.
2019-09-27 19:37:33 +10:00