aboutsummaryrefslogtreecommitdiff
path: root/fiv-browser.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-01-26 15:45:59 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-01-26 16:37:29 +0100
commit935506b120170af249d63b11311fd44163838a12 (patch)
tree354f71ae9910e5e39d0ecc9ef753cdf9cf17fdec /fiv-browser.c
parent84269b2ba21b2f996f5081ea3603457b0a699513 (diff)
downloadfiv-935506b120170af249d63b11311fd44163838a12.tar.gz
fiv-935506b120170af249d63b11311fd44163838a12.tar.xz
fiv-935506b120170af249d63b11311fd44163838a12.zip
Make the Delete key move files to trash in browser
Diffstat (limited to 'fiv-browser.c')
-rw-r--r--fiv-browser.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fiv-browser.c b/fiv-browser.c
index cfff7e2..2e7024a 100644
--- a/fiv-browser.c
+++ b/fiv-browser.c
@@ -1,7 +1,7 @@
//
// fiv-browser.c: filesystem browsing widget
//
-// Copyright (c) 2021 - 2023, Přemysl Eric Janouch <p@janouch.name>
+// Copyright (c) 2021 - 2024, Přemysl Eric Janouch <p@janouch.name>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted.
@@ -1562,6 +1562,14 @@ fiv_browser_key_press_event(GtkWidget *widget, GdkEventKey *event)
switch ((event->state & gtk_accelerator_get_default_mod_mask())) {
case 0:
switch (event->keyval) {
+ case GDK_KEY_Delete:
+ if (self->selected) {
+ GtkWindow *window = GTK_WINDOW(gtk_widget_get_toplevel(widget));
+ GFile *file = g_file_new_for_uri(self->selected->e->uri);
+ fiv_context_menu_remove(window, file);
+ g_object_unref(file);
+ }
+ return GDK_EVENT_STOP;
case GDK_KEY_Return:
if (self->selected)
return open_entry(widget, self->selected, FALSE);