diff --git a/ChangeLog b/ChangeLog index 4f64ff45c5..7d6ce458c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-26 Matthias Clasen + + * gtk/gtkentry.c: Emit ::icon-pressed regardless which button was + pressed. Also make it explicit in the signal signature that the + position parameter is a GtkEntryIconPosition. + 2008-12-26 Matthias Clasen * gtk/gtkentry.c: Emit property notification for the text-length diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 78b15a48c4..1b5fa48f34 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1038,7 +1038,7 @@ gtk_entry_class_init (GtkEntryClass *class) * Whether the primary icon is sensitive. * * An insensitive icon will appear grayed out, it will not emit - * #GtkEntry::icon-pressed signal and not change the cursor. + * #GtkEntry::icon-pressed signal, not allow DND and not change the cursor. * * Since: 2.16 */ @@ -1056,7 +1056,7 @@ gtk_entry_class_init (GtkEntryClass *class) * Whether the secondary icon is sensitive. * * An insensitive icon will appear grayed out, it will not emit - * #GtkEntry::icon-pressed signal and not change the cursor. + * #GtkEntry::icon-pressed signal, not allow DND and not change the cursor. * * Since: 2.16 */ @@ -1199,9 +1199,9 @@ gtk_entry_class_init (GtkEntryClass *class) G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, 0, NULL, NULL, - _gtk_marshal_VOID__INT_BOXED, + _gtk_marshal_VOID__ENUM_BOXED, G_TYPE_NONE, 2, - G_TYPE_INT, + GTK_TYPE_ENTRY_ICON_POSITION, GDK_TYPE_EVENT); /** @@ -1221,9 +1221,9 @@ gtk_entry_class_init (GtkEntryClass *class) G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, 0, NULL, NULL, - _gtk_marshal_VOID__INT_BOXED, + _gtk_marshal_VOID__ENUM_BOXED, G_TYPE_NONE, 2, - G_TYPE_INT, + GTK_TYPE_ENTRY_ICON_POSITION, GDK_TYPE_EVENT); @@ -2703,7 +2703,7 @@ should_prelight (GtkEntry *entry, if (icon_info->nonactivatable && icon_info->target_list == NULL) return FALSE; - if (icon_info->pressed == TRUE) + if (icon_info->pressed) return FALSE; gtk_widget_style_get (GTK_WIDGET (entry), @@ -3106,26 +3106,23 @@ gtk_entry_button_press (GtkWidget *widget, if (event->window == icon_info->window) { - if (event->button == 1) + if (should_prelight (entry, i)) { - if (should_prelight (entry, i)) - { - icon_info->prelight = FALSE; - gtk_widget_queue_draw (widget); - } - - if (icon_info->target_list != NULL) - { - priv->start_x = event->x; - priv->start_y = event->y; - - icon_info->pressed = TRUE; - } - - g_signal_emit (entry, signals[ICON_PRESSED], 0, i, event); - - return TRUE; + icon_info->prelight = FALSE; + gtk_widget_queue_draw (widget); } + + if (icon_info->target_list != NULL) + { + priv->start_x = event->x; + priv->start_y = event->y; + + icon_info->pressed = TRUE; + } + + g_signal_emit (entry, signals[ICON_PRESSED], 0, i, event); + + return TRUE; } } diff --git a/gtk/gtkmarshalers.list b/gtk/gtkmarshalers.list index e55cf505d3..c932f1d555 100644 --- a/gtk/gtkmarshalers.list +++ b/gtk/gtkmarshalers.list @@ -68,8 +68,8 @@ VOID:ENUM,FLOAT VOID:ENUM,FLOAT,BOOLEAN VOID:ENUM,INT VOID:ENUM,INT,BOOLEAN +VOID:ENUM,BOXED VOID:INT -VOID:INT,BOXED VOID:INT,BOOLEAN VOID:INT,INT VOID:INT,INT,BOXED