geary/ui/composer-menus.ui
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

132 lines
4.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<interface>
<menu id="html_menu_model">
<section>
<item>
<attribute name="label" translatable="yes">S_ans Serif</attribute>
<attribute name="action">cmp.font-family</attribute>
<attribute name="target">sans</attribute>
</item>
<item>
<attribute name="label" translatable="yes">S_erif</attribute>
<attribute name="action">cmp.font-family</attribute>
<attribute name="target">serif</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Fixed Width</attribute>
<attribute name="action">cmp.font-family</attribute>
<attribute name="target">monospace</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Small</attribute>
<attribute name="action">cmp.font-size</attribute>
<attribute name="target">small</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Medium</attribute>
<attribute name="action">cmp.font-size</attribute>
<attribute name="target">medium</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Lar_ge</attribute>
<attribute name="action">cmp.font-size</attribute>
<attribute name="target">large</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">C_olor</attribute>
<attribute name="action">cmp.color</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Rich Text</attribute>
<attribute name="action">cmp.compose-as-html</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Show Extended Fields</attribute>
<attribute name="action">cmp.show-extended</attribute>
</item>
</section>
</menu>
<menu id="plain_menu_model">
<section>
<item>
<attribute name="label" translatable="yes">_Rich Text</attribute>
<attribute name="action">cmp.compose-as-html</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Show Extended Fields</attribute>
<attribute name="action">cmp.show-extended</attribute>
</item>
</section>
</menu>
<menu id="context_menu_model">
<section id="context_menu_webkit_spelling"/>
<section>
<item>
<attribute name="label" translatable="yes">_Undo</attribute>
<attribute name="action">cmp.undo</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Redo</attribute>
<attribute name="action">cmp.redo</attribute>
</item>
</section>
<section id="context_menu_rich_text">
<item>
<attribute name="label" translatable="yes">Cu_t</attribute>
<attribute name="action">cmp.cut</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Copy</attribute>
<attribute name="action">cmp.copy</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Paste</attribute>
<attribute name="action">cmp.paste</attribute>
</item>
<item>
<attribute name="label" translatable="yes" context="Clipboard paste with rich text">Paste _With Formatting</attribute>
<attribute name="action">cmp.paste-with-formatting</attribute>
</item>
</section>
<section id="context_menu_plain_text">
<item>
<attribute name="label" translatable="yes">Cu_t</attribute>
<attribute name="action">cmp.cut</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Copy</attribute>
<attribute name="action">cmp.copy</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Paste</attribute>
<attribute name="action">cmp.paste</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">Select _All</attribute>
<attribute name="action">cmp.select-all</attribute>
</item>
</section>
<section id="context_menu_webkit_text_entry"/>
<section id="context_menu_inspector">
<item>
<attribute name="label" translatable="yes">_Inspect…</attribute>
<attribute name="action">cmp.open_inspector</attribute>
</item>
</section>
</menu>
</interface>