[gnome-builder] sourceview: Add corresponding shortcut next to all items in context menu



commit 34f1a2683fa677dd2a1382c78ced173ea041fad8
Author: vanadiae <vanadiae35 gmail com>
Date:   Tue Jun 29 23:07:53 2021 +0200

    sourceview: Add corresponding shortcut next to all items in context menu

 src/libide/sourceview/gtk/menus.ui                  | 15 +++++++++++++++
 src/plugins/beautifier/gb-beautifier-editor-addin.c |  1 +
 src/plugins/comment-code/gtk/menus.ui               |  2 ++
 3 files changed, 18 insertions(+)
---
diff --git a/src/libide/sourceview/gtk/menus.ui b/src/libide/sourceview/gtk/menus.ui
index 7b122b04c..cccd3fc68 100644
--- a/src/libide/sourceview/gtk/menus.ui
+++ b/src/libide/sourceview/gtk/menus.ui
@@ -6,11 +6,13 @@
         <attribute name="id">source-view-goto-def</attribute>
         <attribute name="label" translatable="yes">_Go to Definition</attribute>
         <attribute name="action">sourceview.goto-definition</attribute>
+        <attribute name="accel">&lt;alt&gt;period</attribute>
       </item>
       <item>
         <attribute name="id">source-view-find-references</attribute>
         <attribute name="label" translatable="yes">_Find references</attribute>
         <attribute name="action">sourceview.find-references</attribute>
+        <attribute name="accel">&lt;ctrl&gt;&lt;shift&gt;space</attribute>
       </item>
     </section>
     <section id="ide-source-view-popup-menu-files-section"/>
@@ -18,29 +20,35 @@
       <item>
         <attribute name="label" translatable="yes">_Undo</attribute>
         <attribute name="action">sourceview.undo</attribute>
+        <attribute name="accel">&lt;control&gt;z</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">_Redo</attribute>
         <attribute name="action">sourceview.redo</attribute>
+        <attribute name="accel">&lt;control&gt;&lt;shift&gt;z</attribute>
       </item>
     </section>
     <section id="ide-source-view-popup-menu-clipboard-section">
       <item>
         <attribute name="label" translatable="yes">C_ut</attribute>
         <attribute name="action">sourceview.cut-clipboard</attribute>
+        <attribute name="accel">&lt;control&gt;x</attribute>
       </item>
       <item>
         <attribute name="id">copy</attribute>
         <attribute name="label" translatable="yes">_Copy</attribute>
         <attribute name="action">sourceview.copy-clipboard</attribute>
+        <attribute name="accel">&lt;control&gt;c</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">_Paste</attribute>
         <attribute name="action">sourceview.paste-clipboard</attribute>
+        <attribute name="accel">&lt;control&gt;v</attribute>
       </item>
       <item>
         <attribute name="label" translatable="yes">_Delete</attribute>
         <attribute name="action">sourceview.delete-selection</attribute>
+        <attribute name="accel">Delete</attribute>
       </item>
     </section>
     <section id="ide-source-view-popup-menu-spellcheck-section">
@@ -57,27 +65,32 @@
           <attribute name="label" translatable="yes">Select _All</attribute>
           <attribute name="action">sourceview.select-all</attribute>
           <attribute name="target" type="(b)">(true,)</attribute>
+          <attribute name="accel">&lt;control&gt;a</attribute>
         </item>
         <item>
           <attribute name="label" translatable="yes">Select _None</attribute>
           <attribute name="action">sourceview.select-all</attribute>
           <attribute name="target" type="(b)">(false,)</attribute>
+          <attribute name="accel">&lt;control&gt;backslash</attribute>
         </item>
         <section id="ide-source-view-popup-menu-case-section">
           <item>
             <attribute name="label" translatable="yes">All _Upper Case</attribute>
             <attribute name="action">sourceview.change-case</attribute>
             <attribute name="target" type="(u)">(1,)</attribute>
+            <attribute name="accel">&lt;control&gt;u</attribute>
           </item>
           <item>
             <attribute name="label" translatable="yes">All _Lower Case</attribute>
             <attribute name="action">sourceview.change-case</attribute>
             <attribute name="target" type="(u)">(0,)</attribute>
+            <attribute name="accel">&lt;control&gt;l</attribute>
           </item>
           <item>
             <attribute name="label" translatable="yes">In_vert Case</attribute>
             <attribute name="action">sourceview.change-case</attribute>
             <attribute name="target" type="(u)">(2,)</attribute>
+            <attribute name="accel">&lt;control&gt;asciitilde</attribute>
           </item>
           <item>
             <attribute name="label" translatable="yes">_Title Case</attribute>
@@ -89,11 +102,13 @@
           <item>
             <attribute name="label" translatable="yes">_Join Lines</attribute>
             <attribute name="action">sourceview.join-lines</attribute>
+            <attribute name="accel">&lt;control&gt;j</attribute>
           </item>
           <item>
             <attribute name="label" translatable="yes">S_ort Lines</attribute>
             <attribute name="action">sourceview.sort</attribute>
             <attribute name="target" type="(bb)">(false,false)</attribute>
+            <attribute name="accel">&lt;shift&gt;&lt;control&gt;j</attribute>
           </item>
         </section>
       </submenu>
diff --git a/src/plugins/beautifier/gb-beautifier-editor-addin.c 
b/src/plugins/beautifier/gb-beautifier-editor-addin.c
index 4dcbda5a1..ee0930e2b 100644
--- a/src/plugins/beautifier/gb-beautifier-editor-addin.c
+++ b/src/plugins/beautifier/gb-beautifier-editor-addin.c
@@ -219,6 +219,7 @@ view_populate_submenu (GbBeautifierEditorAddin *self,
             {
               item = g_menu_item_new (entry->name, NULL);
               g_menu_item_set_action_and_target (item, "view.beautify-default", "s", param);
+              g_menu_item_set_attribute (item, "accel", "s", "<ctrl><alt>b");
               g_menu_append_item (default_menu, item);
 
               default_set = TRUE;
diff --git a/src/plugins/comment-code/gtk/menus.ui b/src/plugins/comment-code/gtk/menus.ui
index 8a80177bd..94ca5bcf8 100644
--- a/src/plugins/comment-code/gtk/menus.ui
+++ b/src/plugins/comment-code/gtk/menus.ui
@@ -9,11 +9,13 @@
             <attribute name="label" translatable="yes">_Comment code</attribute>
             <attribute name="action">comment-code.comment-code</attribute>
             <attribute name="target" type="s">'0'</attribute>
+            <attribute name="accel">&lt;control&gt;m</attribute>
           </item>
           <item>
             <attribute name="label" translatable="yes">Unco_mment code</attribute>
             <attribute name="action">comment-code.comment-code</attribute>
             <attribute name="target" type="s">'1'</attribute>
+            <attribute name="accel">&lt;control&gt;&lt;shift&gt;m</attribute>
           </item>
         </section>
       </submenu>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]