diff options
author | Steve Zesch <[email protected]> | 2012-05-28 15:05:27 -0400 |
---|---|---|
committer | Steve Zesch <[email protected]> | 2012-05-28 15:05:27 -0400 |
commit | 9b299865250365f948b523f45a874dce52d125d5 (patch) | |
tree | 53e162312b1ca0badd6787df51ebe585aaf655fb /src | |
parent | 03680f2d95687c0f336993bb44663af3bb0c2ffa (diff) | |
download | caja-9b299865250365f948b523f45a874dce52d125d5.tar.bz2 caja-9b299865250365f948b523f45a874dce52d125d5.tar.xz |
Bookmarks can now be opened via the enter or space key.
Diffstat (limited to 'src')
-rw-r--r-- | src/caja-places-sidebar.c | 22 |
1 files changed, 22 insertions, 0 deletions
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) { |