[nautilus] files-view.c: Fixed delete key hint



commit 08fb4e81877122701a4483f1bdfb3b183c744ac1
Author: Oliver Calder <olivercalder protonmail ch>
Date:   Sat Jul 30 15:16:18 2022 +0000

    files-view.c: Fixed delete key hint
    
    The keypad hint for deleting a file displays as "Delete (keypad)"
    instead of "Delete". It appears that this is due to the order in which
    the Delete key and the Keypad Delete key are bound to the delete action.
    
    In particular, for each of the five delete actions, the GDK_KEY_Delete
    (0xffff) had been bound before the GDK_KEY_KP_Delete (0xff9f). As a
    result, when one of those delete actions was later enabled, the most
    recently bound key was used to populate the shortcut hint.
    
    In this commit, each GDK_KEY_Delete binding is moved below the
    corresponding GDK_KEY_KP_Delete binding so that the non-keypad delete
    is the most recent binding, and thus the shortcut hint correctly
    displays "Delete" instead of "Delete (keypad)".
    
    Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2357

 src/nautilus-files-view.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index fe13d576a..1ba862c7a 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -9496,20 +9496,20 @@ nautilus_files_view_class_init (NautilusFilesViewClass *klass)
      * delete or trash actions with the same shortcut without worrying: only the
      * enabled one will be activated.
      */
-    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, GDK_SHIFT_MASK, 
"view.delete-permanently-shortcut", NULL);
     gtk_widget_class_add_binding_action (widget_class, GDK_KEY_KP_Delete, GDK_SHIFT_MASK, 
"view.delete-permanently-shortcut", NULL);
-    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, GDK_SHIFT_MASK, 
"view.permanent-delete-permanently-menu-item", NULL);
+    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, GDK_SHIFT_MASK, 
"view.delete-permanently-shortcut", NULL);
     gtk_widget_class_add_binding_action (widget_class, GDK_KEY_KP_Delete, GDK_SHIFT_MASK, 
"view.permanent-delete-permanently-menu-item", NULL);
-    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, 0, "view.move-to-trash", NULL);
+    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, GDK_SHIFT_MASK, 
"view.permanent-delete-permanently-menu-item", NULL);
     gtk_widget_class_add_binding_action (widget_class, GDK_KEY_KP_Delete, 0, "view.move-to-trash", NULL);
-    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, 0, "view.delete-from-trash", NULL);
+    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, 0, "view.move-to-trash", NULL);
     gtk_widget_class_add_binding_action (widget_class, GDK_KEY_KP_Delete, 0, "view.delete-from-trash", NULL);
+    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, 0, "view.delete-from-trash", NULL);
     /* When trash is not available, allow the "Delete" keys to delete permanently, that is, when
      * the menu item is available, since we never make both the trash and delete-permanently-menu-item
      * actions active.
      */
-    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, 0, 
"view.delete-permanently-menu-item", NULL);
     gtk_widget_class_add_binding_action (widget_class, GDK_KEY_KP_Delete, 0, 
"view.delete-permanently-menu-item", NULL);
+    gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Delete, 0, 
"view.delete-permanently-menu-item", NULL);
 
     gtk_widget_class_add_binding_action (widget_class, GDK_KEY_F2, 0, "view.rename", NULL);
     gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Menu, 0, "view.popup-menu", NULL);


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