summaryrefslogtreecommitdiff
path: root/src/caja-places-sidebar.c
diff options
context:
space:
mode:
authorSteve Zesch <[email protected]>2012-05-28 15:05:27 -0400
committerSteve Zesch <[email protected]>2012-05-28 15:05:27 -0400
commit9b299865250365f948b523f45a874dce52d125d5 (patch)
tree53e162312b1ca0badd6787df51ebe585aaf655fb /src/caja-places-sidebar.c
parent03680f2d95687c0f336993bb44663af3bb0c2ffa (diff)
downloadcaja-9b299865250365f948b523f45a874dce52d125d5.tar.bz2
caja-9b299865250365f948b523f45a874dce52d125d5.tar.xz
Bookmarks can now be opened via the enter or space key.
Diffstat (limited to 'src/caja-places-sidebar.c')
-rw-r--r--src/caja-places-sidebar.c22
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)
{