[gnome-builder] libide/terminal: cleanup action names/accels
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/terminal: cleanup action names/accels
- Date: Wed, 27 Jul 2022 19:29:49 +0000 (UTC)
commit 181fd1b27a63b4eba7e4dcc25cee466dc24d7945
Author: Christian Hergert <chergert redhat com>
Date: Wed Jul 27 12:29:32 2022 -0700
libide/terminal: cleanup action names/accels
Also fix the widget parent for display.
src/libide/terminal/gtk/menus.ui | 13 ++++++++-----
src/libide/terminal/ide-terminal.c | 9 +++++----
src/plugins/terminal/gtk/keybindings.json | 3 ++-
3 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/src/libide/terminal/gtk/menus.ui b/src/libide/terminal/gtk/menus.ui
index e233a5dba..f1684de20 100644
--- a/src/libide/terminal/gtk/menus.ui
+++ b/src/libide/terminal/gtk/menus.ui
@@ -26,21 +26,23 @@
<attribute name="action">terminal.open-link</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
- <item>
- <attribute name="label" translatable="yes">_Copy Link Address</attribute>
- <attribute name="action">terminal.copy-link-address</attribute>
- <attribute name="hidden-when">action-disabled</attribute>
- </item>
</section>
<section id="ide-terminal-page-popup-menu-clipboard-section">
<item>
<attribute name="id">copy</attribute>
<attribute name="label" translatable="yes">_Copy</attribute>
<attribute name="action">clipboard.copy</attribute>
+ <attribute name="accel"><ctrl><shift>c</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Copy Link</attribute>
+ <attribute name="action">clipboard.copy-link</attribute>
+ <attribute name="hidden-when">action-disabled</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Paste</attribute>
<attribute name="action">clipboard.paste</attribute>
+ <attribute name="accel"><ctrl><shift>v</attribute>
</item>
</section>
<section id="ide-terminal-page-popup-menu-selection-section">
@@ -48,6 +50,7 @@
<attribute name="label" translatable="yes">Select _All</attribute>
<attribute name="action">terminal.select-all</attribute>
<attribute name="target" type="b">true</attribute>
+ <attribute name="accel"><ctrl><shift>a</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Select _None</attribute>
diff --git a/src/libide/terminal/ide-terminal.c b/src/libide/terminal/ide-terminal.c
index 44e09041f..86a787638 100644
--- a/src/libide/terminal/ide-terminal.c
+++ b/src/libide/terminal/ide-terminal.c
@@ -189,7 +189,7 @@ ide_terminal_update_url_actions (IdeTerminal *self,
pattern = ide_terminal_get_pattern_at_coords (self, x, y);
- gtk_widget_action_set_enabled (GTK_WIDGET (self), "terminal.copy-link-address", pattern != NULL);
+ gtk_widget_action_set_enabled (GTK_WIDGET (self), "clipboard.copy-link", pattern != NULL);
gtk_widget_action_set_enabled (GTK_WIDGET (self), "terminal.open-link", pattern != NULL);
ide_set_string (&priv->url, pattern);
@@ -200,7 +200,7 @@ clear_url_actions_cb (gpointer data)
{
IdeTerminal *self = data;
- gtk_widget_action_set_enabled (GTK_WIDGET (self), "terminal.copy-link-address", FALSE);
+ gtk_widget_action_set_enabled (GTK_WIDGET (self), "clipboard.copy-link", FALSE);
gtk_widget_action_set_enabled (GTK_WIDGET (self), "terminal.open-link", FALSE);
return G_SOURCE_REMOVE;
@@ -238,6 +238,7 @@ ide_terminal_popup (IdeTerminal *self,
priv->popover = GTK_POPOVER (gtk_popover_menu_new_from_model (G_MENU_MODEL (menu)));
gtk_popover_set_has_arrow (priv->popover, FALSE);
gtk_widget_set_halign (GTK_WIDGET (priv->popover), GTK_ALIGN_END);
+ gtk_widget_set_parent (GTK_WIDGET (priv->popover), GTK_WIDGET (self));
g_signal_connect_object (priv->popover,
"closed",
@@ -582,10 +583,10 @@ ide_terminal_class_init (IdeTerminalClass *klass)
g_assert (filename_regex != NULL);
gtk_widget_class_install_action (widget_class, "clipboard.copy", NULL, copy_clipboard_action);
+ gtk_widget_class_install_action (widget_class, "clipboard.copy-link", NULL, copy_link_address_action);
gtk_widget_class_install_action (widget_class, "clipboard.paste", NULL, paste_clipboard_action);
- gtk_widget_class_install_action (widget_class, "terminal.copy-link-address", NULL,
copy_link_address_action);
gtk_widget_class_install_action (widget_class, "terminal.open-link", NULL, open_link_action);
- gtk_widget_class_install_action (widget_class, "terminal.search-reveal", NULL, ide_terminal_search_reveal);
+ gtk_widget_class_install_action (widget_class, "terminal.search", NULL, ide_terminal_search_reveal);
gtk_widget_class_install_action (widget_class, "terminal.select-all", "b", select_all_action);
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_c, GDK_CONTROL_MASK|GDK_SHIFT_MASK,
"clipboard.copy", NULL);
diff --git a/src/plugins/terminal/gtk/keybindings.json b/src/plugins/terminal/gtk/keybindings.json
index 271ccd108..bde7d2148 100644
--- a/src/plugins/terminal/gtk/keybindings.json
+++ b/src/plugins/terminal/gtk/keybindings.json
@@ -6,7 +6,8 @@
/* IdeTerminal */
{ "trigger" : "<Control><Shift>c", "action" : "clipboard.copy", "when" : "inTerminal()", "phase" : "capture"
},
{ "trigger" : "<Control><Shift>v", "action" : "clipboard.paste", "when" : "inTerminal()", "phase" :
"capture" },
-{ "trigger" : "<Control><Shift>f", "action" : "terminal.search-reveal", "when" : "inTerminal()", "phase" :
"capture" },
+{ "trigger" : "<Control><Shift>a", "action" : "terminal.select-all", "args" : "true", "when" :
"inTerminal()", "phase" : "capture" },
+{ "trigger" : "<Control><Shift>f", "action" : "terminal.search", "when" : "inTerminal()", "phase" :
"capture" },
{ "trigger" : "<Control><Shift>braceleft", "action" : "page.move-left", "when" : "inTerminal()", "phase" :
"capture" },
{ "trigger" : "<Control><Shift>braceright", "action" : "page.move-right", "when" : "inTerminal()", "phase" :
"capture" },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]