From dabbac11517bfddd43ec734885472c51a1a11cb6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 28 Feb 2004 22:28:37 +0000 Subject: [PATCH] Actually resize the popup window before popping up. (#135651) Sat Feb 28 23:30:36 2004 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_popup): Actually resize the popup window before popping up. (#135651) Sat Feb 28 23:29:35 2004 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_class_init): * gtk/gtkcombobox.c (gtk_combo_box_init): Override the default handler for style_set in class_init instead of connecting to the signal in init. (noticed by Yosh). --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-4 | 12 ++++++++++++ ChangeLog.pre-2-6 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ gtk/gtkcombobox.c | 15 +++++++-------- 6 files changed, 67 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2606188b..87e3aa0b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Sat Feb 28 23:30:36 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): Actually resize the + popup window before popping up. (#135651) + +Sat Feb 28 23:29:35 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_class_init): + * gtk/gtkcombobox.c (gtk_combo_box_init): Override the default + handler for style_set in class_init instead of connecting to + the signal in init. (noticed by Yosh). + Sat Feb 28 14:48:35 2004 Owen Taylor * demos/gtk-demo/main.c (read_line): #ifdef HAVE_FLOCKFILE, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e2606188b..87e3aa0b1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +Sat Feb 28 23:30:36 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): Actually resize the + popup window before popping up. (#135651) + +Sat Feb 28 23:29:35 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_class_init): + * gtk/gtkcombobox.c (gtk_combo_box_init): Override the default + handler for style_set in class_init instead of connecting to + the signal in init. (noticed by Yosh). + Sat Feb 28 14:48:35 2004 Owen Taylor * demos/gtk-demo/main.c (read_line): #ifdef HAVE_FLOCKFILE, diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e2606188b..87e3aa0b1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +Sat Feb 28 23:30:36 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): Actually resize the + popup window before popping up. (#135651) + +Sat Feb 28 23:29:35 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_class_init): + * gtk/gtkcombobox.c (gtk_combo_box_init): Override the default + handler for style_set in class_init instead of connecting to + the signal in init. (noticed by Yosh). + Sat Feb 28 14:48:35 2004 Owen Taylor * demos/gtk-demo/main.c (read_line): #ifdef HAVE_FLOCKFILE, diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e2606188b..87e3aa0b1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +Sat Feb 28 23:30:36 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): Actually resize the + popup window before popping up. (#135651) + +Sat Feb 28 23:29:35 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_class_init): + * gtk/gtkcombobox.c (gtk_combo_box_init): Override the default + handler for style_set in class_init instead of connecting to + the signal in init. (noticed by Yosh). + Sat Feb 28 14:48:35 2004 Owen Taylor * demos/gtk-demo/main.c (read_line): #ifdef HAVE_FLOCKFILE, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e2606188b..87e3aa0b1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +Sat Feb 28 23:30:36 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): Actually resize the + popup window before popping up. (#135651) + +Sat Feb 28 23:29:35 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_class_init): + * gtk/gtkcombobox.c (gtk_combo_box_init): Override the default + handler for style_set in class_init instead of connecting to + the signal in init. (noticed by Yosh). + Sat Feb 28 14:48:35 2004 Owen Taylor * demos/gtk-demo/main.c (read_line): #ifdef HAVE_FLOCKFILE, diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 3e5ce1594..2c35ca376 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -374,6 +374,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass) widget_class->expose_event = gtk_combo_box_expose_event; widget_class->scroll_event = gtk_combo_box_scroll_event; widget_class->mnemonic_activate = gtk_combo_box_mnemonic_activate; + widget_class->style_set = gtk_combo_box_style_set; gtk_object_class = (GtkObjectClass *)klass; gtk_object_class->destroy = gtk_combo_box_destroy; @@ -471,9 +472,6 @@ gtk_combo_box_init (GtkComboBox *combo_box) { combo_box->priv = GTK_COMBO_BOX_GET_PRIVATE (combo_box); - g_signal_connect (combo_box, "style_set", - G_CALLBACK (gtk_combo_box_style_set), NULL); - combo_box->priv->cell_view = gtk_cell_view_new (); gtk_container_add (GTK_CONTAINER (combo_box), combo_box->priv->cell_view); gtk_widget_show (combo_box->priv->cell_view); @@ -820,7 +818,7 @@ gtk_combo_box_menu_position (GtkMenu *menu, void gtk_combo_box_popup (GtkComboBox *combo_box) { - gint x, y, width, height; + gint x, y, width, height, popup_height; GtkWidget *sample; g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); @@ -864,9 +862,10 @@ gtk_combo_box_popup (GtkComboBox *combo_box) GTK_WIDGET (combo_box->priv->cell_view_frame)->style->xthickness); } - gtk_widget_set_size_request (combo_box->priv->popup_window, - width, -1); - + gtk_window_get_size (combo_box->priv->popup_window, NULL, &popup_height); + gtk_widget_set_size_request (combo_box->priv->popup_window, width, -1); + gtk_window_resize (combo_box->priv->popup_window, width, popup_height); + if (GTK_WIDGET_NO_WINDOW (sample)) { x += sample->allocation.x; @@ -983,7 +982,7 @@ gtk_combo_box_remeasure (GtkComboBox *combo_box) GtkRequisition req; if (combo_box->priv->cell_view) - gtk_cell_view_get_size_of_row (GTK_CELL_VIEW (combo_box->priv->cell_view), + gtk_cell_view_get_size_of_row (GTK_CELL_VIEW (combo_box->priv->cell_view), path, &req); else req.width = 0;