diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-11-01 04:38:24 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-11-01 04:38:24 +0000 |
commit | 5675f113c8c02b613661a1dbfb10b2396baa7062 (patch) | |
tree | 09daf04132d0b5ef601bed014e79d3926cf76c73 | |
parent | 8dada077be2b1d14b5a0b8257855274c0f81d142 (diff) | |
download | gtk+-5675f113c8c02b613661a1dbfb10b2396baa7062.tar.gz |
Update the state of the cell view when the state of the button changes (to
2004-10-31 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): Update the
state of the cell view when the state of the button changes (to
get prelighted drawing right). (#138650, Frances Keenan, Christian Persch)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 4 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 4 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 4 | ||||
-rw-r--r-- | gtk/gtkcombobox.c | 27 |
5 files changed, 43 insertions, 0 deletions
@@ -1,5 +1,9 @@ 2004-10-31 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): Update the + state of the cell view when the state of the button changes (to + get prelighted drawing right). (#138650, Frances Keenan, Christian Persch) + * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): Don't force the height of the action area, we don't scroll it anyway, and the current way of calculating the height can lead diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 81a75c176a..0ff469bbe2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2004-10-31 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): Update the + state of the cell view when the state of the button changes (to + get prelighted drawing right). (#138650, Frances Keenan, Christian Persch) + * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): Don't force the height of the action area, we don't scroll it anyway, and the current way of calculating the height can lead diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 81a75c176a..0ff469bbe2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,9 @@ 2004-10-31 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): Update the + state of the cell view when the state of the button changes (to + get prelighted drawing right). (#138650, Frances Keenan, Christian Persch) + * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): Don't force the height of the action area, we don't scroll it anyway, and the current way of calculating the height can lead diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 81a75c176a..0ff469bbe2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,9 @@ 2004-10-31 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkcombobox.c (gtk_combo_box_button_state_changed): Update the + state of the cell view when the state of the button changes (to + get prelighted drawing right). (#138650, Frances Keenan, Christian Persch) + * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): Don't force the height of the action area, we don't scroll it anyway, and the current way of calculating the height can lead diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index f6dace279f..aabb3b3c1e 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -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, @@ -779,6 +782,23 @@ gtk_combo_box_state_changed (GtkWidget *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) { gboolean appears_as_list; @@ -2301,6 +2321,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 (); @@ -2451,6 +2474,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); |