Commit graph

10 commits

Author SHA1 Message Date
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
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
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
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
9eead5d145 Replace composer keyboard shortcut with standard widget action scoping
Rather than adding and removing shortcuts when the composer's web view
gains and loses focus to avoid invoking main window shortcuts, just
rely on standard GTK action scoping rules.

This fixes editing shortcuts like Ctrl+I breaking when clicking on
toolbar buttons, a crasher because the composer left the undo button
enabled after it was closed, and allows Escape to close the composer
from anywherre.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=774651,
https://bugzilla.gnome.org/show_bug.cgi?id=785187, and
https://bugzilla.gnome.org/show_bug.cgi?id=741741
2019-02-13 23:25:58 +11:00
Alex Henrie
7ab6f713fb Fix context of "Paste Without Formatting" 2018-07-27 12:36:30 -06:00
Alex Henrie
74a6802dca Make generic "Paste" action paste with formatting if possible 2018-07-26 09:18:19 -06:00
Michael James Gratton
20db6e57dd Re-enable custom composer context menu, add WK text entry items to it.
* src/client/composer/composer-widget.vala
  (ComposerWidget::action_entries): Add an entry for the inspector so it
  can be loaded via the context model in the same way as other items.
  (ComposerWidget::context_menu_*): Keep track of a number of the context
  menu's sections, so we can selectively include them in the WK context
  menu.
  (ComposerWidget::on_context_menu): Re-implement to work wth the WK2
  context menu model, which annoyingly doesn't even extend any of the
  GtkMenu infrastrcuture.

* src/client/util/util-gtk.vala (menu_foreach): Pass the action
  target through to the loop's delegate, it's a bit more useful for
  dealing with the WK2 model.
  (add_g_menu_to_gtk_menu): Removed, WebKitContextMenu doesn't extend
  Gtk.Menu any longer so this is is no longer needed.

* ui/composer-menus.ui: Reoganise to use standard composer action
  prefix. Duplicate rich and plain text clipboard sections so they can
  just be selectively enabled. Include dummy sections for WK items to
  specify where they are located in the menu, and a section for the
  inspector.
2017-02-01 00:41:44 +11:00
Niels De Graef
56c10aca94 Fix for the context menu. Bug 770356.
Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
2016-09-21 15:02:31 +10:00
Niels De Graef
ebd788968b Use GLib.Actions in the composer. Bug 770356.
Now using these instead of the old composer's actions. This led to quite
some changes:

* Use GLib.ActionEntry instead of Gtk.ActionEntry in
  composer-widget.vala
* Action names can now be specified in the UI files.
* Use templates for the ComposerHeaderBar. Remove
  Pillbar as superclass, since that was no longer necessary.
* Merge ComposerToolbar into ComposerWidget.
* Since actions can now be parameterized, some methods could be
  merged (e.g. font size methods).
* The menu button in the composer now automatically uses a popover.
* Some methods and classes really deserved more comments.
* necessary POTFILES.in changes

Signed-off-by: Niels De Graef <nielsdegraef@gmail.com>
2016-09-21 15:02:18 +10:00