diff options
author | Kristian Rietveld <kris@gtk.org> | 2011-01-07 15:10:06 +0100 |
---|---|---|
committer | Kristian Rietveld <kris@gtk.org> | 2011-01-07 15:38:06 +0100 |
commit | 688d0534362917a4ff171846e9e9cabb250b37c7 (patch) | |
tree | 8f2dcfdb686ed79fd3db4b2bbeab37b92898a5f3 /gtk/gtktreeviewcolumn.c | |
parent | c40c4a45e5ce326a685729e458410a9857a0cc62 (diff) | |
download | gtk+-688d0534362917a4ff171846e9e9cabb250b37c7.tar.gz |
Fix gtk_tree_view_column_cell_get_position()
Diffstat (limited to 'gtk/gtktreeviewcolumn.c')
-rw-r--r-- | gtk/gtktreeviewcolumn.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 00a2ea7499..612732f549 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -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; |