Fix gtk_tree_view_column_cell_get_position()

This commit is contained in:
Kristian Rietveld 2011-01-07 15:10:06 +01:00
parent c40c4a45e5
commit 688d053436

View File

@ -2972,7 +2972,7 @@ gtk_tree_view_column_cell_get_position (GtkTreeViewColumn *tree_column,
gint *width)
{
GtkTreeViewColumnPrivate *priv;
GdkRectangle zero_cell_area = { 0, };
GdkRectangle cell_area;
GdkRectangle allocation;
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
@ -2980,16 +2980,24 @@ gtk_tree_view_column_cell_get_position (GtkTreeViewColumn *tree_column,
priv = tree_column->priv;
/* FIXME: Could use a boolean return value for invalid cells */
gtk_tree_view_get_background_area (GTK_TREE_VIEW (priv->tree_view),
NULL, tree_column, &cell_area);
gtk_cell_area_get_cell_allocation (priv->cell_area,
priv->cell_area_context,
priv->tree_view,
cell_renderer,
&zero_cell_area,
&cell_area,
&allocation);
if (x_offset)
*x_offset = allocation.x;
{
GdkRectangle button_allocation;
/* Retrieve column offset */
gtk_widget_get_allocation (priv->button, &button_allocation);
*x_offset = allocation.x - button_allocation.x;
}
if (width)
*width = allocation.width;