From 9b299865250365f948b523f45a874dce52d125d5 Mon Sep 17 00:00:00 2001 From: Steve Zesch Date: Mon, 28 May 2012 15:05:27 -0400 Subject: Bookmarks can now be opened via the enter or space key. --- src/caja-places-sidebar.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c index 52c1048e..81805845 100644 --- a/src/caja-places-sidebar.c +++ b/src/caja-places-sidebar.c @@ -2367,9 +2367,31 @@ bookmarks_key_press_event_cb (GtkWidget *widget, CajaPlacesSidebar *sidebar) { guint modifiers; + GtkTreeModel *model; + GtkTreePath *path; + CajaWindowOpenFlags flags = 0; modifiers = gtk_accelerator_get_default_mod_mask (); + if (event->keyval == GDK_Return || + event->keyval == GDK_KP_Enter || + event->keyval == GDK_ISO_Enter || + event->keyval == GDK_space) + { + if ((event->state & modifiers) == GDK_SHIFT_MASK) + flags = CAJA_WINDOW_OPEN_FLAG_NEW_TAB; + else if ((event->state & modifiers) == GDK_CONTROL_MASK) + flags = CAJA_WINDOW_OPEN_FLAG_NEW_WINDOW; + + model = gtk_tree_view_get_model(sidebar->tree_view); + gtk_tree_view_get_cursor(sidebar->tree_view, &path, NULL); + + open_selected_bookmark(sidebar, model, path, flags); + + gtk_tree_path_free(path); + return TRUE; + } + if (event->keyval == GDK_Down && (event->state & modifiers) == GDK_MOD1_MASK) { -- cgit v1.2.1