From a2bd3c74be06c1d90a9e59548116362833c6bf80 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 11 May 2004 19:15:56 +0000 Subject: [PATCH] don't allocate the popup smaller than the combobox. Fixes bug #59660. 2004-05-11 Michael Natterer * gtk/gtkcombobox.c (gtk_combo_box_popup) (gtk_combo_box_menu_button_press): don't allocate the popup smaller than the combobox. Fixes bug #59660. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkcombobox.c | 16 +++++++++++++--- 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae0c9ca9f7..296f65b297 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-05-11 Michael Natterer + + * gtk/gtkcombobox.c (gtk_combo_box_popup) + (gtk_combo_box_menu_button_press): don't allocate the popup + smaller than the combobox. Fixes bug #59660. + 2004-05-11 Matthias Clasen * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ae0c9ca9f7..296f65b297 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2004-05-11 Michael Natterer + + * gtk/gtkcombobox.c (gtk_combo_box_popup) + (gtk_combo_box_menu_button_press): don't allocate the popup + smaller than the combobox. Fixes bug #59660. + 2004-05-11 Matthias Clasen * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ae0c9ca9f7..296f65b297 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2004-05-11 Michael Natterer + + * gtk/gtkcombobox.c (gtk_combo_box_popup) + (gtk_combo_box_menu_button_press): don't allocate the popup + smaller than the combobox. Fixes bug #59660. + 2004-05-11 Matthias Clasen * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ae0c9ca9f7..296f65b297 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2004-05-11 Michael Natterer + + * gtk/gtkcombobox.c (gtk_combo_box_popup) + (gtk_combo_box_menu_button_press): don't allocate the popup + smaller than the combobox. Fixes bug #59660. + 2004-05-11 Matthias Clasen * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 291c46b18e..eaca7a9680 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -1170,8 +1170,13 @@ gtk_combo_box_popup (GtkComboBox *combo_box) if (combo_box->priv->wrap_width == 0) { + GtkRequisition requisition; + width = GTK_WIDGET (combo_box)->allocation.width; - gtk_widget_set_size_request (combo_box->priv->popup_widget, width, -1); + gtk_widget_size_request (combo_box->priv->popup_widget, &requisition); + + gtk_widget_set_size_request (combo_box->priv->popup_widget, + MAX (width, requisition.width), -1); } gtk_menu_popup (GTK_MENU (combo_box->priv->popup_widget), @@ -1945,7 +1950,6 @@ gtk_combo_box_menu_button_press (GtkWidget *widget, gpointer user_data) { GtkComboBox *combo_box = GTK_COMBO_BOX (user_data); - gint width; if (! GTK_IS_MENU (combo_box->priv->popup_widget)) return FALSE; @@ -1959,8 +1963,14 @@ gtk_combo_box_menu_button_press (GtkWidget *widget, if (combo_box->priv->wrap_width == 0) { + GtkRequisition requisition; + gint width; + width = GTK_WIDGET (combo_box)->allocation.width; - gtk_widget_set_size_request (combo_box->priv->popup_widget, width, -1); + gtk_widget_size_request (combo_box->priv->popup_widget, &requisition); + + gtk_widget_set_size_request (combo_box->priv->popup_widget, + MAX (width, requisition.width), -1); } gtk_menu_popup (GTK_MENU (combo_box->priv->popup_widget),