[nautilus] places-sidebar: allow keyboard navigation with Enter/Space (#637768)
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] places-sidebar: allow keyboard navigation with Enter/Space (#637768)
- Date: Thu, 27 Jan 2011 03:46:23 +0000 (UTC)
commit fd03c910a73ba18459e68baaf15e8dd295acd5c1
Author: Stefano Teso <stefano teso gmail com>
Date: Wed Jan 26 22:43:55 2011 -0500
places-sidebar: allow keyboard navigation with Enter/Space (#637768)
src/nautilus-places-sidebar.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index e63e8f4..828b9d0 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -2410,6 +2410,30 @@ bookmarks_key_press_event_cb (GtkWidget *widget,
modifiers = gtk_accelerator_get_default_mod_mask ();
+ if ((event->keyval == GDK_KEY_Return ||
+ event->keyval == GDK_KEY_KP_Enter ||
+ event->keyval == GDK_KEY_ISO_Enter ||
+ event->keyval == GDK_KEY_space)) {
+
+ GtkTreeModel *model;
+ GtkTreePath *path;
+ NautilusWindowOpenFlags flags = 0;
+
+ if ((event->state & modifiers) == GDK_SHIFT_MASK) {
+ flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+ } else if ((event->state & modifiers) == GDK_CONTROL_MASK) {
+ flags = NAUTILUS_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_KEY_Down &&
(event->state & modifiers) == GDK_MOD1_MASK) {
return eject_or_unmount_selection (sidebar);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]