Skip to content
  • Michael Gratton's avatar
    Reenable undo/redo composer actions. · 2bd5306d
    Michael Gratton authored
    * 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.
    2bd5306d