]> Pileus Git - ~andy/gtk/commitdiff
Transfer state from the button to the cell view to get prelighting right.
authorMatthias Clasen <mclasen@redhat.com>
Fri, 24 Dec 2004 03:44:17 +0000 (03:44 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 24 Dec 2004 03:44:17 +0000 (03:44 +0000)
2004-12-23  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkcombobox.c (gtk_combo_box_button_state_changed):
Transfer state from the button to the cell view to get
prelighting right.  (#156327, Ricardo Veguilla)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c

index 6f411ab779ddaaa5dac12735eefd7424552fe46c..33c2271cdc01958b33cea6398a74f896526ddf37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-12-23  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): 
+       Transfer state from the button to the cell view to get
+       prelighting right.  (#156327, Ricardo Veguilla)
+
 Wed Dec 22 14:22:19 2004  Søren Sandmann  <sandmann@redhat.com>
 
        * tests/testtoolbar.c (timeout_cb): Add sensitivity-changing
index 6f411ab779ddaaa5dac12735eefd7424552fe46c..33c2271cdc01958b33cea6398a74f896526ddf37 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-23  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): 
+       Transfer state from the button to the cell view to get
+       prelighting right.  (#156327, Ricardo Veguilla)
+
 Wed Dec 22 14:22:19 2004  Søren Sandmann  <sandmann@redhat.com>
 
        * tests/testtoolbar.c (timeout_cb): Add sensitivity-changing
index 6f411ab779ddaaa5dac12735eefd7424552fe46c..33c2271cdc01958b33cea6398a74f896526ddf37 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-23  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): 
+       Transfer state from the button to the cell view to get
+       prelighting right.  (#156327, Ricardo Veguilla)
+
 Wed Dec 22 14:22:19 2004  Søren Sandmann  <sandmann@redhat.com>
 
        * tests/testtoolbar.c (timeout_cb): Add sensitivity-changing
index 6f411ab779ddaaa5dac12735eefd7424552fe46c..33c2271cdc01958b33cea6398a74f896526ddf37 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-23  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): 
+       Transfer state from the button to the cell view to get
+       prelighting right.  (#156327, Ricardo Veguilla)
+
 Wed Dec 22 14:22:19 2004  Søren Sandmann  <sandmann@redhat.com>
 
        * tests/testtoolbar.c (timeout_cb): Add sensitivity-changing
index f0acdd1b5c69172df53c2c3cb9c0c01b17497d0b..eb567fb5f2e2cdc98ce0c47a6f7c7c43a9d2522f 100644 (file)
@@ -225,6 +225,9 @@ static void     gtk_combo_box_style_set            (GtkWidget       *widget,
                                                     GtkStyle        *previous);
 static void     gtk_combo_box_button_toggled       (GtkWidget       *widget,
                                                     gpointer         data);
+static void     gtk_combo_box_button_state_changed (GtkWidget       *widget,
+                                                   GtkStateType     previous,
+                                                   gpointer         data);
 static void     gtk_combo_box_add                  (GtkContainer    *container,
                                                     GtkWidget       *widget);
 static void     gtk_combo_box_remove               (GtkContainer    *container,
@@ -841,6 +844,23 @@ gtk_combo_box_state_changed (GtkWidget    *widget,
   gtk_widget_queue_draw (widget);
 }
 
+static void
+gtk_combo_box_button_state_changed (GtkWidget    *widget,
+                                   GtkStateType  previous,
+                                   gpointer      data)
+{
+  GtkComboBox *combo_box = GTK_COMBO_BOX (data);
+
+  if (GTK_WIDGET_REALIZED (widget))
+    {
+      if (!combo_box->priv->tree_view && combo_box->priv->cell_view)
+       gtk_widget_set_state (combo_box->priv->cell_view, 
+                             GTK_WIDGET_STATE (widget));
+    }
+
+  gtk_widget_queue_draw (widget);
+}
+
 static void
 gtk_combo_box_check_appearance (GtkComboBox *combo_box)
 {
@@ -2365,6 +2385,9 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
   g_signal_connect (combo_box->priv->button, "button_press_event",
                     G_CALLBACK (gtk_combo_box_menu_button_press),
                     combo_box);
+  g_signal_connect (combo_box->priv->button, "state_changed",
+                   G_CALLBACK (gtk_combo_box_button_state_changed), 
+                   combo_box);
 
   /* create our funky menu */
   menu = gtk_menu_new ();
@@ -2517,6 +2540,10 @@ gtk_combo_box_menu_destroy (GtkComboBox *combo_box)
                                         G_SIGNAL_MATCH_DATA,
                                         0, 0, NULL,
                                         gtk_combo_box_menu_button_press, NULL);
+  g_signal_handlers_disconnect_matched (combo_box->priv->button,
+                                        G_SIGNAL_MATCH_DATA,
+                                        0, 0, NULL,
+                                        gtk_combo_box_button_state_changed, combo_box);
 
   /* unparent will remove our latest ref */
   gtk_widget_unparent (combo_box->priv->button);