]> Pileus Git - ~andy/gtk/commitdiff
Small fixes to the icon entry code
authorMatthias Clasen <matthiasc@src.gnome.org>
Sat, 27 Dec 2008 02:25:15 +0000 (02:25 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 27 Dec 2008 02:25:15 +0000 (02:25 +0000)
svn path=/trunk/; revision=21939

ChangeLog
gtk/gtkentry.c
gtk/gtkmarshalers.list

index 4f64ff45c53897a48d8e08851f9e814e4bb13465..7d6ce458c5becb9748eb2722ca13c340e7c162b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-26  Matthias Clasen  <mclasen@redhat.com>
+
+       * 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  <mclasen@redhat.com>
 
        * gtk/gtkentry.c: Emit property notification for the text-length
index 78b15a48c4ecf20992e442f5fad372dc8627c852..1b5fa48f34f05f8f017d0c56bca5a14bbc7a17fb 100644 (file)
@@ -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);
-                }
+              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;
+          if (icon_info->target_list != NULL)
+            {
+              priv->start_x = event->x;
+              priv->start_y = event->y;
 
-                  icon_info->pressed = TRUE;
-                }
+              icon_info->pressed = TRUE;
+            }
 
-              g_signal_emit (entry, signals[ICON_PRESSED], 0, i, event);
+          g_signal_emit (entry, signals[ICON_PRESSED], 0, i, event);
 
-              return TRUE;
-            }
+          return TRUE;
         }
     }
 
index e55cf505d31ea77ffdecbbffebed26f5f5abae20..c932f1d555c73103663d8b35b3903da4d10b221d 100644 (file)
@@ -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