summaryrefslogtreecommitdiff
path: root/gtk/gtkcombobox.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2003-11-17 12:10:06 +0000
committerKristian Rietveld <kristian@src.gnome.org>2003-11-17 12:10:06 +0000
commit04c21b2c9ba82a39293c76b6e0a99abaeac8f21d (patch)
treebca8e9c384adafcbb0dafb73983b3e34e18c54ca /gtk/gtkcombobox.c
parenta4e8e3dee5b5a86d1eae198bb0c7f0f051dd3799 (diff)
downloadgtk+-04c21b2c9ba82a39293c76b6e0a99abaeac8f21d.tar.gz
Temporary size requisition fix. Will fix it for real tonight.
Mon Nov 17 12:58:32 2003 Kristian Rietveld <kris@gtk.org> Temporary size requisition fix. Will fix it for real tonight. * gtk/gtkcombobox.c (gtk_combo_box_remeasure): add a resize flag, (gtk_combo_box_size_request): use gtk_combo_box_remeasure to determine a good width for the child, (gtk_combo_box_cell_layout_add_attribute), (gtk_combo_box_set_cell_data_func), (gtk_combo_box_cell_layout_clear_attributes): update.
Diffstat (limited to 'gtk/gtkcombobox.c')
-rw-r--r--gtk/gtkcombobox.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index b94964a67d..6f9099de61 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -166,7 +166,8 @@ static void gtk_combo_box_popdown (GtkComboBox *combo_box)
static gint gtk_combo_box_calc_requested_width (GtkComboBox *combo_box,
GtkTreePath *path);
-static void gtk_combo_box_remeasure (GtkComboBox *combo_box);
+static void gtk_combo_box_remeasure (GtkComboBox *combo_box,
+ gboolean resize);
static void gtk_combo_box_unset_model (GtkComboBox *combo_box);
static void gtk_combo_box_set_model_internal (GtkComboBox *combo_box);
@@ -805,7 +806,8 @@ gtk_combo_box_calc_requested_width (GtkComboBox *combo_box,
}
static void
-gtk_combo_box_remeasure (GtkComboBox *combo_box)
+gtk_combo_box_remeasure (GtkComboBox *combo_box,
+ gboolean resize)
{
GtkTreeIter iter;
GtkTreePath *path;
@@ -842,7 +844,7 @@ gtk_combo_box_remeasure (GtkComboBox *combo_box)
gtk_tree_path_free (path);
- if (combo_box->priv->cell_view)
+ if (combo_box->priv->cell_view && resize)
{
gtk_widget_set_size_request (combo_box->priv->cell_view,
combo_box->priv->width, -1);
@@ -861,6 +863,8 @@ gtk_combo_box_size_request (GtkWidget *widget,
/* common */
gtk_widget_size_request (GTK_BIN (widget)->child, &bin_req);
+ gtk_combo_box_remeasure (combo_box, FALSE);
+ bin_req.width = MAX (bin_req.width, combo_box->priv->width);
if (!combo_box->priv->tree_view)
{
@@ -2124,7 +2128,7 @@ gtk_combo_box_cell_layout_add_attribute (GtkCellLayout *layout,
g_list_free (list);
}
- gtk_combo_box_remeasure (combo_box);
+ gtk_combo_box_remeasure (combo_box, TRUE);
}
static void
@@ -2184,7 +2188,7 @@ gtk_combo_box_cell_layout_set_cell_data_func (GtkCellLayout *layout,
g_list_free (list);
}
- gtk_combo_box_remeasure (combo_box);
+ gtk_combo_box_remeasure (combo_box, TRUE);
}
static void
@@ -2240,7 +2244,7 @@ gtk_combo_box_cell_layout_clear_attributes (GtkCellLayout *layout,
g_list_free (list);
}
- gtk_combo_box_remeasure (combo_box);
+ gtk_combo_box_remeasure (combo_box, TRUE);
}
/*