evolution-data-server r9916 - branches/gnome-2-24/libedataserverui
- From: msuman svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9916 - branches/gnome-2-24/libedataserverui
- Date: Mon, 12 Jan 2009 04:23:58 +0000 (UTC)
Author: msuman
Date: Mon Jan 12 04:23:58 2009
New Revision: 9916
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9916&view=rev
Log:
Milan Crha <mcrha redhat com> ** Fix for bug #562200 (Left click of mouse disables calendar).
Modified:
branches/gnome-2-24/libedataserverui/ChangeLog
branches/gnome-2-24/libedataserverui/e-source-selector.c
Modified: branches/gnome-2-24/libedataserverui/e-source-selector.c
==============================================================================
--- branches/gnome-2-24/libedataserverui/e-source-selector.c (original)
+++ branches/gnome-2-24/libedataserverui/e-source-selector.c Mon Jan 12 04:23:58 2009
@@ -76,6 +76,63 @@
G_DEFINE_TYPE (ESourceSelector, e_source_selector, GTK_TYPE_TREE_VIEW)
+/* safe-toggle-renderer definition - it'll not call 'toggled' signal on 'activate', when mouse is not over the toggle */
+
+typedef struct _ECellRendererSafeToggle {
+ GtkCellRendererToggle parent;
+} ECellRendererSafeToggle;
+
+typedef struct _ECellRendererSafeToggleClass {
+ GtkCellRendererToggleClass parent_class;
+} ECellRendererSafeToggleClass;
+
+GType e_cell_renderer_safe_toggle_get_type (void);
+
+G_DEFINE_TYPE (ECellRendererSafeToggle, e_cell_renderer_safe_toggle, GTK_TYPE_CELL_RENDERER_TOGGLE)
+
+static gboolean
+safe_toggle_activate (GtkCellRenderer *cell,
+ GdkEvent *event,
+ GtkWidget *widget,
+ const gchar *path,
+ GdkRectangle *background_area,
+ GdkRectangle *cell_area,
+ GtkCellRendererState flags)
+{
+ if (event->type == GDK_BUTTON_PRESS && cell_area) {
+ GdkRegion *reg = gdk_region_rectangle (cell_area);
+
+ if (!gdk_region_point_in (reg, event->button.x, event->button.y)) {
+ gdk_region_destroy (reg);
+ return FALSE;
+ }
+
+ gdk_region_destroy (reg);
+ }
+
+ return GTK_CELL_RENDERER_CLASS (e_cell_renderer_safe_toggle_parent_class)->activate (cell, event, widget, path, background_area, cell_area, flags);
+}
+
+static void
+e_cell_renderer_safe_toggle_class_init (ECellRendererSafeToggleClass *klass)
+{
+ GtkCellRendererClass *rndr_class;
+
+ rndr_class = GTK_CELL_RENDERER_CLASS (klass);
+ rndr_class->activate = safe_toggle_activate;
+}
+
+static void
+e_cell_renderer_safe_toggle_init (ECellRendererSafeToggle *obj)
+{
+}
+
+static GtkCellRenderer *
+e_cell_renderer_safe_toggle_new (void)
+{
+ return g_object_new (e_cell_renderer_safe_toggle_get_type (), NULL);
+}
+
/* Selection management. */
static GHashTable *
@@ -937,7 +994,7 @@
g_object_set (G_OBJECT (cell_renderer), "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
gtk_tree_view_column_pack_start (column, cell_renderer, FALSE);
gtk_tree_view_column_set_cell_data_func (column, cell_renderer, (GtkTreeCellDataFunc) pixbuf_cell_data_func, selector, NULL);
- cell_renderer = gtk_cell_renderer_toggle_new ();
+ cell_renderer = e_cell_renderer_safe_toggle_new ();
gtk_tree_view_column_pack_start (column, cell_renderer, FALSE);
gtk_tree_view_column_set_cell_data_func (column, cell_renderer, (GtkTreeCellDataFunc) toggle_cell_data_func, selector, NULL);
g_signal_connect (cell_renderer, "toggled", G_CALLBACK (cell_toggled_callback), selector);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]