[nautilus] places-sidebar: use gtk_tree_view_set_activate_on_single_click



commit 277a6a45bee8186b2493ad1b286234ac52f1aed8
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jan 22 20:35:01 2013 -0500

    places-sidebar: use gtk_tree_view_set_activate_on_single_click
    
    This also bumps the required GTK version to the current git master.

 configure.ac                  |    2 +-
 src/nautilus-places-sidebar.c |   29 ++++++++++++++++++++++++-----
 2 files changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 835e5a0..3c118f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ dnl ===========================================================================
 m4_define(glib_minver,                 2.35.3)
 m4_define(gnome_desktop_minver,        3.0.0)
 m4_define(pango_minver,                1.28.3)
-m4_define(gtk_minver,                  3.7.5)
+m4_define(gtk_minver,                  3.7.7)
 m4_define(xml_minver,                  2.7.8)
 m4_define(exif_minver,                 0.6.20)
 m4_define(exempi_minver,               2.1.0)
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index 79c7f0d..1e37f03 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -2807,6 +2807,22 @@ bookmarks_popup_menu_cb (GtkWidget *widget,
 	return TRUE;
 }
 
+static void
+bookmarks_row_activated_cb (GtkWidget *widget,
+			    GtkTreePath *path,
+			    GtkTreeViewColumn *column,
+			    NautilusPlacesSidebar *sidebar)
+{
+	GtkTreeIter iter;
+	GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
+
+	if (!gtk_tree_model_get_iter (model, &iter, path)) {
+		return;
+	}
+
+	open_selected_bookmark (sidebar, model, &iter, 0);
+}
+
 static gboolean
 bookmarks_button_release_event_cb (GtkWidget *widget,
 				   GdkEventButton *event,
@@ -2832,6 +2848,10 @@ bookmarks_button_release_event_cb (GtkWidget *widget,
 		return FALSE;
 	}
 
+	if (event->button == 1) {
+		return FALSE;
+	}
+
 	tree_view = GTK_TREE_VIEW (widget);
 	model = gtk_tree_view_get_model (tree_view);
 
@@ -2852,9 +2872,7 @@ bookmarks_button_release_event_cb (GtkWidget *widget,
 		return FALSE;
 	}
 
-	if (event->button == 1) {
-		open_selected_bookmark (sidebar, model, &iter, 0);
-	} else if (event->button == 2) {
+	if (event->button == 2) {
 		NautilusWindowOpenFlags flags = 0;
 
 		flags = (event->state & GDK_CONTROL_MASK) ?
@@ -3323,9 +3341,10 @@ nautilus_places_sidebar_init (NautilusPlacesSidebar *sidebar)
 			  G_CALLBACK (bookmarks_popup_menu_cb), sidebar);
 	g_signal_connect (tree_view, "button-release-event",
 			  G_CALLBACK (bookmarks_button_release_event_cb), sidebar);
+	g_signal_connect (tree_view, "row-activated",
+			  G_CALLBACK (bookmarks_row_activated_cb), sidebar);
 
-	eel_gtk_tree_view_set_activate_on_single_click (sidebar->tree_view,
-							TRUE);
+	gtk_tree_view_set_activate_on_single_click (sidebar->tree_view, TRUE);
 
 	g_signal_connect_swapped (gnome_background_preferences, "changed::" NAUTILUS_PREFERENCES_SHOW_DESKTOP,
 				  G_CALLBACK(desktop_setting_changed_callback),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]