[gnome-control-center/single-window-shell: 6/9] [shell] implement single click to "activate" items
- From: Thomas Wood <thos src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-control-center/single-window-shell: 6/9] [shell] implement single click to "activate" items
- Date: Mon, 11 Jan 2010 09:48:13 +0000 (UTC)
commit f119dfb98d977c399f35b4f559da9737adf509c9
Author: Thomas Wood <thomas wood intel com>
Date: Wed Dec 2 16:52:10 2009 +0000
[shell] implement single click to "activate" items
Connect to button-release-event of the icon views to enable the user to
use a single click to activate items.
shell/control-center.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/shell/control-center.c b/shell/control-center.c
index 22e9d24..2368c4b 100644
--- a/shell/control-center.c
+++ b/shell/control-center.c
@@ -26,6 +26,28 @@
void item_activated_cb (GtkIconView *icon_view, GtkTreePath *path, GtkBuilder *builder);
+gboolean
+button_release_cb (GtkWidget *view,
+ GdkEventButton *event,
+ GtkBuilder *builder)
+{
+ if (event->button == 1)
+ {
+ GList *selection;
+
+ selection = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (view));
+
+ if (!selection)
+ return FALSE;
+
+ item_activated_cb (GTK_ICON_VIEW (view), selection->data, builder);
+
+ g_list_free (selection);
+ return TRUE;
+ }
+ return FALSE;
+}
+
void
selection_changed_cb (GtkIconView *view,
GtkBuilder *builder)
@@ -98,6 +120,8 @@ fill_model (GtkBuilder *b)
gtk_icon_view_set_item_width (GTK_ICON_VIEW (iconview), 120);
g_signal_connect (iconview, "item-activated",
G_CALLBACK (item_activated_cb), b);
+ g_signal_connect (iconview, "button-release-event",
+ G_CALLBACK (button_release_cb), b);
g_signal_connect (iconview, "selection-changed",
G_CALLBACK (selection_changed_cb), b);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]