summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2004-02-28 22:28:37 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-02-28 22:28:37 +0000
commitdabbac11517bfddd43ec734885472c51a1a11cb6 (patch)
tree959cc3593a0b5aa21f86e3a4f41afef130ace0fa /gtk
parent9a0fa4a78d54caee6fa61085f21c9899cc0a91fc (diff)
downloadgtk+-dabbac11517bfddd43ec734885472c51a1a11cb6.tar.gz
Actually resize the popup window before popping up. (#135651)
Sat Feb 28 23:30:36 2004 Matthias Clasen <maclas@gmx.de> * 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 <maclas@gmx.de> * 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).
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkcombobox.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 3e5ce15942..2c35ca3769 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;