Commit graph

26 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
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
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
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
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
Joel Duncan
ab555ed28d Add margin_bottom padding to composer_toolbar 2019-02-18 00:16:22 +00:00
Michael Gratton
e8dc1af45e Scope composer editor shortcuts to the toolbar and web view only
This prevents something like Ctrl+I being typed in the subject line
triggering italic in the editor.
2019-02-13 23:25:58 +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
Adrien Plazas
6d17bfb062 composer-widget: Fix the info label xalignment
This prevents the label from flickering when it is ellipsized and the
window is being resized.
2019-01-29 11:17:08 +01:00
Michael James Gratton
adf168218e Ensure composer overlay widget isn't visible by default.
Followup for commit 07b4a784.
2018-04-16 11:46:00 +10: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
7fa755f0b7 Work around composer info label being too long. Fixes Bug 790435.
* ui/composer-widget.ui: Make the info label esliipsisable, but give it a
  reasonable minimum size.

* src/client/composer/composer-widget.vala (ComposerWidget): Set the info
  label's tooltip with the text so it can still be read when ellipsed.
2018-04-14 12:46:55 +10:00
Michael James Gratton
5a9075b345 Fix TRUE/FALSE listed as composer drafts status.
* src/client/composer/composer-widget.vala (Composer): Replace use of
  inappropriate public properties and obtuse property bindings with a
  subject_changed signal and private properties that update the info
  label in their setter, so it's obvious how the whole thing works. Move
  code for managing a detached compoer's window title to the
  ComposerWindow class.
2018-04-14 12:37:22 +10:00
Michael James Gratton
2f35e40e46 Swap position of UL and OL lists, to be in that order. 2017-12-12 23:32:43 +11:00
Nikolas Tapia
63521d8566 Added support for lists in composer
This attempts to solve bug
[#714921](https://bugzilla.gnome.org/show_bug.cgi?id=714921).

They are available as two buttons on the format bar, next to font
options. The icons I used are taken from a free icons site just for demo
purposes and should be replaced by new icons. Also I did not include
hotkeys mainly because I could not come up with a good one, also they
are pretty uncommon I think.

Also added new icons to icons/CMakeLists.txt
2017-12-12 23:32:28 +11:00
Michael James Gratton
57ca408c53 Fix composer UI brokenness when compiled under vala 0.36.
Don't rely ComposerState::state notify and property bindings firing when
the value hasn't actually changed to update the composer's UI. This is
works around Vala Bug 631267 landing.

* src/client/composer/composer-headerbar.vala (ComposerHeaderbar): Add
  signal and methods to be called explicity on state changes, rather than
  relying on being notified of ComposerWidget::state changing.

* src/client/composer/composer-widget.vala (ComposerWidget): Hook up new
  ComposerHeaderbar signal and method. Remove notify and property
  bindings on ::state property, move related code to new
  ::update_composer_view method and call that as needed. Remove
  overridden ::show_all, because the UI state should now always be
  consistent with ::state. Clean up various methods.

* src/client/composer/email-entry.vala (EmailEntry::EmailEntry): Make
  widget visible by default, since we are no longer calling
  ComposerWidget::show_all().

* src/client/application/geary-controller.vala: Don't call show all on
  new composers, they now manage their visibility properly.

* ui/composer-headerbar.ui: Make toolbar icons visible by default.

* ui/composer-widget.ui: Make toolbar icons visible by default, set Send
  button icon here rather than in the class.
2017-03-04 13:45:17 +11:00
Michael James Gratton
9e171d0db1 Remove composer's scrolled window since WebView now scrolls internally.
We can't easily wrap ComposerWebView in a GtkScrolledWindow, since we
don't any notifications that the cursor has moved offscreen and hence the
view needs to be scrolled, so let the view do its own scrolling.

* ui/composer-widget.ui: Replace editor_scrolled with editor_container,
  update uses.
2017-02-01 00:41:44 +11:00
Michael James Gratton
f27dea1318 Update some composer action tooltips. 2017-02-01 00:41:44 +11:00
Michael James Gratton
f8957c4d7a Ensure draft is saved when envelope (from, to, etc) changes. Bug 726290.
* src/client/composer/composer-widget.vala (ComposerWidget): Rename
  subject changed handler to something more generic, hook that up to the
  to/cc/bcc & reply_to entries.

* ui/composer-widget.ui: Hook up multiple to on_envelope_changed, make
  subject entry use that as well.
2017-02-01 00:41:44 +11:00
Michael James Gratton
2bd5306d30 Reenable undo/redo composer actions.
* src/client/composer/composer-web-view.vala (ComposerWebView): Add new
  ::command_stack_changed signal to manage undo/redo enabled state, hook
  it up to a JS callback. Add ::is_empty property as a non-functioning
  shim in lieu of can_undo going away. Remove ::can_undo and ::can_redo,
  replace them with methods to actually fire an undo and redo.

* src/client/composer/composer-widget.vala (ComposerWidget): Use
  ClientWebView::is_empty rather inplace of can_redo for determining
  editing state. Remove old undo/redo signal hookups, replace with
  ::command_stack_changed and manage action enable state from there.
  (ComposerWidget::action_entries): Add explicit actions for undo/redo,
  since they need some custom code over on on the web process side.
  (ComposerWidget::on_compose_as_html_toggled): Explciitly manage the
  visibility of rich text toolbar buttons, don't rely on obscure
  GtkBuilder magic that Glade doesn't support.

* ui/composer-web-view.js: Add a mutation observer for the message body
  and explcit methods for firing undo/redo commands, so we can keep track
  of how the command stack changes. As it does, fire commandStackChanged
  messages back to the client process. Explicity set the message body as
  content-editable after the document has been mutated for quotes, etc.

* ui/composer-widget.ui: Add bonus undo/redo toobar buttons for the
  composer.
2017-02-01 00:41:44 +11:00
Michael James Gratton
478ab2d700 Use click-to-focus prop on toolbar buttons rather than other workarounds.
* src/client/application/geary-controller.vala
  (GearyController::archive_or_delete_selection_async): Don't modify the
  focus after archiving/trashing/deleting.

* src/client/components/pill-toolbar.vala, ui/composer-headerbar.ui,
  ui/composer-widget.ui: Ensure all toolbar buttons are focusable but
  have focus-on-click disabled.
2016-10-20 16:58:48 +11:00
Michael James Gratton
d8fbb6f971 Ensure composer web views are always visible. 2016-10-04 10:58:17 +11:00
Michael James Gratton
8191ed4298 Add Insert Image button, action and hander to composer. Bug 712995.
* src/client/composer/composer-widget.vala (ComposerWidget): Add action
  and callback that simply does a normal attachment for now.

* ui/composer-widget.ui: Add insert image button to the composer toobar.
2016-10-04 10:35:49 +11: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