Fixed GtkCellView to always allocate when in fit-model mode.

This commit is contained in:
Tristan Van Berkom 2010-11-24 18:27:51 +09:00
parent 83c69f4cf3
commit 39cf1576d7

View File

@ -516,8 +516,12 @@ gtk_cell_view_size_allocate (GtkWidget *widget,
gtk_cell_area_context_get_allocation (priv->context, &alloc_width, &alloc_height); gtk_cell_area_context_get_allocation (priv->context, &alloc_width, &alloc_height);
/* The first cell view in context is responsible for allocating the context at allocate time /* The first cell view in context is responsible for allocating the context at allocate time
* (or the cellview has its own context and is not grouped with any other cell views) */ * (or the cellview has its own context and is not grouped with any other cell views)
if (alloc_width <= 0 && alloc_height <= 0) *
* If the cellview is in "fit model" mode, we assume its not in context and needs to
* allocate every time.
*/
if ((alloc_width <= 0 && alloc_height <= 0) || priv->fit_model)
{ {
gtk_cell_area_context_allocate_width (priv->context, allocation->width); gtk_cell_area_context_allocate_width (priv->context, allocation->width);
gtk_cell_area_context_allocate_height (priv->context, allocation->height); gtk_cell_area_context_allocate_height (priv->context, allocation->height);