[gnome-control-center] shell: Activate items on single click



commit a98e81e1c3bc111f55a9d6065b43282676688688
Author: William Jon McCann <jmccann redhat com>
Date:   Fri Jan 18 02:49:38 2013 -0500

    shell: Activate items on single click
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692150

 configure.ac               |    2 +-
 shell/cc-shell-item-view.c |   47 +++----------------------------------------
 2 files changed, 5 insertions(+), 44 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ef2a6d1..2aa6558 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,7 +93,7 @@ dnl Check that we meet the  dependencies
 dnl ==============================================
 
 GLIB_REQUIRED_VERSION=2.35.1
-GTK_REQUIRED_VERSION=3.5.13
+GTK_REQUIRED_VERSION=3.7.7
 PA_REQUIRED_VERSION=2.0
 CANBERRA_REQUIRED_VERSION=0.13
 GDKPIXBUF_REQUIRED_VERSION=2.23.0
diff --git a/shell/cc-shell-item-view.c b/shell/cc-shell-item-view.c
index cc8ae98..42a31d7 100644
--- a/shell/cc-shell-item-view.c
+++ b/shell/cc-shell-item-view.c
@@ -28,7 +28,7 @@ G_DEFINE_TYPE (CcShellItemView, cc_shell_item_view, GTK_TYPE_ICON_VIEW)
 
 struct _CcShellItemViewPrivate
 {
-  gboolean ignore_release;
+  gpointer padding;
 };
 
 
@@ -79,43 +79,6 @@ cc_shell_item_view_finalize (GObject *object)
   G_OBJECT_CLASS (cc_shell_item_view_parent_class)->finalize (object);
 }
 
-static gboolean
-iconview_button_press_event_cb (GtkWidget       *widget,
-                                GdkEventButton  *event,
-                                CcShellItemView *cc_view)
-{
-  /* be sure to ignore double and triple clicks */
-  cc_view->priv->ignore_release = (event->type != GDK_BUTTON_PRESS);
-
-  return FALSE;
-}
-
-static gboolean
-iconview_button_release_event_cb (GtkWidget       *widget,
-                                  GdkEventButton  *event,
-                                  CcShellItemView *cc_view)
-{
-  CcShellItemViewPrivate *priv = cc_view->priv;
-
-  if (event->button == 1 && !priv->ignore_release)
-    {
-      GList *selection;
-
-      selection =
-        gtk_icon_view_get_selected_items (GTK_ICON_VIEW (cc_view));
-
-      if (!selection)
-        return TRUE;
-
-      gtk_icon_view_item_activated (GTK_ICON_VIEW (cc_view),
-                                    (GtkTreePath*) selection->data);
-
-      g_list_free (selection);
-    }
-
-  return TRUE;
-}
-
 static void
 iconview_item_activated_cb (GtkIconView     *icon_view,
                             GtkTreePath     *path,
@@ -198,14 +161,12 @@ cc_shell_item_view_init (CcShellItemView *self)
   g_object_set (self, "margin", 0, NULL);
   g_signal_connect (self, "item-activated",
                     G_CALLBACK (iconview_item_activated_cb), self);
-  g_signal_connect (self, "button-press-event",
-                    G_CALLBACK (iconview_button_press_event_cb), self);
-  g_signal_connect (self, "button-release-event",
-                    G_CALLBACK (iconview_button_release_event_cb), self);
 }
 
 GtkWidget *
 cc_shell_item_view_new (void)
 {
-  return g_object_new (CC_TYPE_SHELL_ITEM_VIEW, NULL);
+  return g_object_new (CC_TYPE_SHELL_ITEM_VIEW,
+                       "activate-on-single-click", TRUE,
+                       NULL);
 }



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