Commit 688d0534 authored by Kristian Rietveld's avatar Kristian Rietveld

Fix gtk_tree_view_column_cell_get_position()

parent c40c4a45
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment