diff options
author | Wynn Wolf Arbor | 2020-03-28 15:16:31 +0100 |
---|---|---|
committer | Wynn Wolf Arbor | 2020-04-13 15:45:39 +0200 |
commit | ec211bccdcfb5bfabd03f6bcff8df02bb5eab266 (patch) | |
tree | 6a160f34eb37a5ce17be1b19e0858d35b5a17e26 /terminal.ui | |
parent | 30bbf529ad3073fd449c7f9331a889b114fad1e1 (diff) | |
download | weltschmerz-ec211bccdcfb5bfabd03f6bcff8df02bb5eab266.tar.gz |
Add Copy to HTML feature
This commit adds a "Copy to HTML" entry to the context menu. It is
active when VTE registers an active selection. Lines copied like this
will be put into the clipboard as formatted HTML, retaining nearly all
styling information.
For this, vte_copy now takes a boolean argument - whether or not to
format the lines copied as HTML. As two menu items now access vte_copy
directly, and there is no clean way of passing arguments to signal
handlers through terminal.ui, signals for both menu items are now
connected in the Vala code instead.
Diffstat (limited to 'terminal.ui')
-rw-r--r-- | terminal.ui | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/terminal.ui b/terminal.ui index 4ba9555..4618d40 100644 --- a/terminal.ui +++ b/terminal.ui @@ -232,17 +232,26 @@ <property name="visible">True</property> <property name="can_focus">False</property> <child> - <object class="GtkImageMenuItem" id="copy_item"> + <object class="GtkImageMenuItem" id="copy_item_text"> <property name="label">gtk-copy</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> - <signal name="activate" handler="vte_copy" swapped="no"/> <accelerator key="c" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/> </object> </child> <child> + <object class="GtkImageMenuItem" id="copy_item_html"> + <property name="label">Copy as _HTML</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Copy the selection as HTML</property> + <property name="use_underline">True</property> + <property name="use_stock">False</property> + </object> + </child> + <child> <object class="GtkImageMenuItem" id="paste_item"> <property name="label">gtk-paste</property> <property name="visible">True</property> |